sp1_stark

Struct Chip

source
pub struct Chip<F: Field, A> { /* private fields */ }
Expand description

An Air that encodes lookups based on interactions.

Implementations§

source§

impl<F: Field, A> Chip<F, A>

source

pub fn sends(&self) -> &[Interaction<F>]

The send interactions of the chip.

source

pub fn receives(&self) -> &[Interaction<F>]

The receive interactions of the chip.

source

pub const fn log_quotient_degree(&self) -> usize

The relative log degree of the quotient polynomial, i.e. log2(max_constraint_degree - 1).

source

pub fn into_inner(self) -> A

Consumes the chip and returns the underlying air.

source§

impl<F: PrimeField32, A: MachineAir<F>> Chip<F, A>

source

pub fn included(&self, shard: &A::Record) -> bool

Returns whether the given chip is included in the execution record of the shard.

source§

impl<F, A> Chip<F, A>
where F: Field, A: BaseAir<F>,

source

pub fn new(air: A) -> Self

Records the interactions and constraint degree from the air and crates a new chip.

source

pub fn num_interactions(&self) -> usize

Returns the number of interactions in the chip.

source

pub fn num_sent_byte_lookups(&self) -> usize

Returns the number of sent byte lookups in the chip.

source

pub fn num_sends_by_kind(&self, kind: InteractionKind) -> usize

Returns the number of sends of the given kind.

source

pub fn num_receives_by_kind(&self, kind: InteractionKind) -> usize

Returns the number of receives of the given kind.

source

pub fn generate_permutation_trace<EF: ExtensionField<F>>( &self, preprocessed: Option<&RowMajorMatrix<F>>, main: &RowMajorMatrix<F>, random_elements: &[EF], ) -> (RowMajorMatrix<EF>, EF, EF)
where F: PrimeField, A: MachineAir<F>,

Generates a permutation trace for the given matrix.

source

pub fn permutation_width(&self) -> usize

Returns the width of the permutation trace.

source

pub fn cost(&self) -> u64

Returns the cost of a row in the chip.

source

pub const fn quotient_width(&self) -> usize

Returns the width of the quotient polynomial.

source

pub const fn logup_batch_size(&self) -> usize

Returns the log2 of the batch size.

Trait Implementations§

source§

impl<'a, F, A, AB> Air<AB> for Chip<F, A>
where F: Field, A: Air<AB>, AB: SP1AirBuilder<F = F> + MultiTableAirBuilder<'a> + PairBuilder + 'a,

source§

fn eval(&self, builder: &mut AB)

source§

impl<F, A> BaseAir<F> for Chip<F, A>
where F: Field, A: BaseAir<F>,

source§

fn width(&self) -> usize

The number of columns (a.k.a. registers) in this AIR.
source§

fn preprocessed_trace(&self) -> Option<RowMajorMatrix<F>>

source§

impl<F, A> Hash for Chip<F, A>
where F: Field, A: Hash,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<F, A> MachineAir<F> for Chip<F, A>
where F: Field, A: MachineAir<F>,

source§

type Record = <A as MachineAir<F>>::Record

The execution record containing events for producing the air trace.
source§

type Program = <A as MachineAir<F>>::Program

The program that defines the control flow of the machine.
source§

fn name(&self) -> String

A unique identifier for this AIR as part of a machine.
source§

fn preprocessed_width(&self) -> usize

The width of the preprocessed trace.
source§

fn generate_preprocessed_trace( &self, program: &A::Program, ) -> Option<RowMajorMatrix<F>>

Generate the preprocessed trace given a specific program.
source§

fn generate_trace( &self, input: &A::Record, output: &mut A::Record, ) -> RowMajorMatrix<F>

Generate the trace for a given execution record. Read more
source§

fn generate_dependencies(&self, input: &A::Record, output: &mut A::Record)

Generate the dependencies for a given execution record.
source§

fn included(&self, shard: &Self::Record) -> bool

Whether this execution record contains events for this air.
source§

fn commit_scope(&self) -> InteractionScope

Specifies whether it’s trace should be part of either the global or local commit.
source§

impl<F, A> PartialEq for Chip<F, A>
where F: Field, A: PartialEq,

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F, A: Eq> Eq for Chip<F, A>
where F: Field + Eq,

Auto Trait Implementations§

§

impl<F, A> Freeze for Chip<F, A>
where A: Freeze,

§

impl<F, A> RefUnwindSafe for Chip<F, A>

§

impl<F, A> Send for Chip<F, A>
where A: Send,

§

impl<F, A> Sync for Chip<F, A>
where A: Sync,

§

impl<F, A> Unpin for Chip<F, A>
where A: Unpin, F: Unpin,

§

impl<F, A> UnwindSafe for Chip<F, A>
where A: UnwindSafe, F: UnwindSafe,

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
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

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

Initializes a with the given initializer. Read more
source§

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

Dereferences the given pointer. Read more
source§

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

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

source§

type Output = T

Should always be Self
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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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