Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::SumcheckProverRound< Flavor >::ChunkStealer Struct Reference

Shared chunk scheduler for dynamic work-stealing in the sumcheck prover's main loop. More...

#include <sumcheck_round.hpp>

Public Member Functions

 ChunkStealer (size_t start, size_t end, size_t rpc)
 
size_t num_slots () const
 
std::optional< std::pair< size_t, size_t > > pop ()
 

Public Attributes

const size_t start_edge_idx
 
const size_t end_edge_idx
 
const size_t rows_per_chunk
 
const size_t total_chunks
 
std::atomic< size_t > next_chunk { 0 }
 

Detailed Description

template<typename Flavor>
struct bb::SumcheckProverRound< Flavor >::ChunkStealer

Shared chunk scheduler for dynamic work-stealing in the sumcheck prover's main loop.

Splits the edge range [start_edge_idx, end_edge_idx) into fixed-size chunks and hands them out via an atomic counter. Workers call pop() in a loop; each call returns the next chunk to process (or nullopt when the range is exhausted). Spawns at most as many threads as there are chunks. Designed to balance thread-work by accounting for the non-uniform cost of relation algebra execution across different rows of the trace.

Definition at line 201 of file sumcheck_round.hpp.

Constructor & Destructor Documentation

◆ ChunkStealer()

template<typename Flavor >
bb::SumcheckProverRound< Flavor >::ChunkStealer::ChunkStealer ( size_t  start,
size_t  end,
size_t  rpc 
)
inline

Definition at line 208 of file sumcheck_round.hpp.

Member Function Documentation

◆ num_slots()

template<typename Flavor >
size_t bb::SumcheckProverRound< Flavor >::ChunkStealer::num_slots ( ) const
inline

Definition at line 220 of file sumcheck_round.hpp.

◆ pop()

template<typename Flavor >
std::optional< std::pair< size_t, size_t > > bb::SumcheckProverRound< Flavor >::ChunkStealer::pop ( )
inline

Definition at line 222 of file sumcheck_round.hpp.

Member Data Documentation

◆ end_edge_idx

template<typename Flavor >
const size_t bb::SumcheckProverRound< Flavor >::ChunkStealer::end_edge_idx

Definition at line 203 of file sumcheck_round.hpp.

◆ next_chunk

template<typename Flavor >
std::atomic<size_t> bb::SumcheckProverRound< Flavor >::ChunkStealer::next_chunk { 0 }

Definition at line 206 of file sumcheck_round.hpp.

◆ rows_per_chunk

template<typename Flavor >
const size_t bb::SumcheckProverRound< Flavor >::ChunkStealer::rows_per_chunk

Definition at line 204 of file sumcheck_round.hpp.

◆ start_edge_idx

template<typename Flavor >
const size_t bb::SumcheckProverRound< Flavor >::ChunkStealer::start_edge_idx

Definition at line 202 of file sumcheck_round.hpp.

◆ total_chunks

template<typename Flavor >
const size_t bb::SumcheckProverRound< Flavor >::ChunkStealer::total_chunks

Definition at line 205 of file sumcheck_round.hpp.


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