Skip to main content

ProvingMemoryConfig

Struct ProvingMemoryConfig 

Source
pub struct ProvingMemoryConfig {
    pub base_field_size: usize,
    pub extension_degree: usize,
    pub log_blowup: usize,
    pub l_skip: usize,
    pub max_constraint_degree: usize,
    pub cache_rs_code_matrix: bool,
}
Expand description

Configuration for proving memory estimates.

Fields§

§base_field_size: usize

Size of one base-field element in bytes.

§extension_degree: usize

Degree of the extension field over the base field.

§log_blowup: usize

-log_2 of the rate for the initial Reed-Solomon code.

§l_skip: usize

log_2 of the univariate skip domain.

§max_constraint_degree: usize

Maximum constraint degree across AIR and interaction constraints.

§cache_rs_code_matrix: bool

Whether the prover keeps the Reed-Solomon code matrix cached after stacked_commit.

Implementations§

Source§

impl ProvingMemoryConfig

Source

pub fn from_protocol_config<SC: StarkProtocolConfig>( config: &SC, cache_rs_code_matrix: bool, ) -> Self

Source

pub fn main_memory_bytes(&self, main_cells: usize) -> usize

Source

pub fn rs_code_matrix_memory_bytes(&self, main_cells: usize) -> usize

Source

pub fn main_cell_secondary_weight(&self) -> f64

Source

pub fn main_secondary_memory_bytes_for_rot( &self, main_cells: usize, need_rot: bool, ) -> usize

Secondary memory for main_cells = Σ(padded_height * width).

mat_eval_bytes = (padded_height / 2^l_skip) * ((1 + need_rot) * width) * sizeof(EF)
               = (1 + need_rot) * main_cells * D_EF / 2^l_skip * sizeof(F)

interp_bytes      = (constraint_degree / 2) * mat_eval_bytes
secondary_bytes   = (1 + constraint_degree / 2) * mat_eval_bytes
secondary_weight  = (1 + constraint_degree / 2) * D_EF / 2^l_skip

AIRs with need_rot = true open two PCS cells per column.

Source

pub fn main_secondary_memory_bytes(&self, counts: ProvingMemoryCounts) -> usize

Source

pub fn interaction_memory_bytes_without_overhead( &self, interaction_cells: usize, ) -> usize

Source

pub fn interaction_memory_bytes(&self, interaction_cells: usize) -> usize

Source

pub fn estimate(&self, counts: ProvingMemoryCounts) -> ProvingMemoryEstimate

Convert main trace cells and interaction cells to memory bytes.

main_cells       = main_cells_with_rot + main_cells_without_rot
main             = main_cells * sizeof(F)
rs_code_matrix   = main_cells * 2^log_blowup * sizeof(F)
main_secondary   = sizeof(F) *
                   (2 * main_cell_secondary_weight() * main_cells_with_rot
                    + main_cell_secondary_weight() * main_cells_without_rot)
interaction      = sizeof(F) * interaction_cell_weight * interaction_cells
                   + INTERACTION_MEMORY_OVERHEAD

Cached RS code matrix:

total = main + rs_code_matrix + max(main_secondary, interaction)

Dropped RS code matrix:

total = main + max(rs_code_matrix, main_secondary, interaction)

Trait Implementations§

Source§

impl Clone for ProvingMemoryConfig

Source§

fn clone(&self) -> ProvingMemoryConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ProvingMemoryConfig

Source§

impl Debug for ProvingMemoryConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ProvingMemoryConfig

Source§

fn eq(&self, other: &ProvingMemoryConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProvingMemoryConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more