pub struct BasicAdapterInterface<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize>(/* private fields */);
Expand description
The most common adapter interface.
Performs NUM_READS
batch reads of size READ_SIZE
and
NUM_WRITES
batch writes of size WRITE_SIZE
.
Trait Implementations§
Source§impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> VmAdapterInterface<T> for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> VmAdapterInterface<T> for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
Source§type Reads = [[T; READ_SIZE]; NUM_READS]
type Reads = [[T; READ_SIZE]; NUM_READS]
The memory read data that should be exposed for downstream use
Source§type Writes = [[T; WRITE_SIZE]; NUM_WRITES]
type Writes = [[T; WRITE_SIZE]; NUM_WRITES]
The memory write data that are expected to be provided by the integrator
Source§type ProcessedInstruction = PI
type ProcessedInstruction = PI
The parts of the instruction that should be exposed to the integrator.
This will typically include
is_valid
, which indicates whether the trace row
is being used and opcode
to indicate which opcode is being executed if the
VmChip supports multiple opcodes.Source§impl<AB: InteractionBuilder + AirBuilderWithPublicValues> VmCoreAir<AB, BasicAdapterInterface<<AB as AirBuilder>::Expr, MinimalInstruction<<AB as AirBuilder>::Expr>, 2, 0, 1, 1>> for PublicValuesCoreAir
impl<AB: InteractionBuilder + AirBuilderWithPublicValues> VmCoreAir<AB, BasicAdapterInterface<<AB as AirBuilder>::Expr, MinimalInstruction<<AB as AirBuilder>::Expr>, 2, 0, 1, 1>> for PublicValuesCoreAir
Source§fn eval(
&self,
builder: &mut AB,
local_core: &[AB::Var],
_from_pc: AB::Var,
) -> AdapterAirContext<AB::Expr, BasicAdapterInterface<AB::Expr, MinimalInstruction<AB::Expr>, 2, 0, 1, 1>>
fn eval( &self, builder: &mut AB, local_core: &[AB::Var], _from_pc: AB::Var, ) -> AdapterAirContext<AB::Expr, BasicAdapterInterface<AB::Expr, MinimalInstruction<AB::Expr>, 2, 0, 1, 1>>
Returns
(to_pc, interface)
.Source§impl<F: PrimeField32> VmCoreChip<F, BasicAdapterInterface<F, MinimalInstruction<F>, 2, 0, 1, 1>> for PublicValuesCoreChip<F>
impl<F: PrimeField32> VmCoreChip<F, BasicAdapterInterface<F, MinimalInstruction<F>, 2, 0, 1, 1>> for PublicValuesCoreChip<F>
Source§type Record = PublicValuesRecord<F>
type Record = PublicValuesRecord<F>
Minimum data that must be recorded to be able to generate trace for one row of
PrimitiveAir
.Source§type Air = PublicValuesCoreAir
type Air = PublicValuesCoreAir
The primitive AIR with main constraints that do not depend on memory and other architecture-specifics.
fn execute_instruction( &self, _instruction: &Instruction<F>, _from_pc: u32, reads: <BasicAdapterInterface<F, MinimalInstruction<F>, 2, 0, 1, 1> as VmAdapterInterface<F>>::Reads, ) -> Result<(AdapterRuntimeContext<F, BasicAdapterInterface<F, MinimalInstruction<F>, 2, 0, 1, 1>>, Self::Record)>
fn get_opcode_name(&self, opcode: usize) -> String
Source§fn generate_trace_row(&self, row_slice: &mut [F], record: Self::Record)
fn generate_trace_row(&self, row_slice: &mut [F], record: Self::Record)
Populates
row_slice
with values corresponding to record
.
The provided row_slice
will have length equal to self.air().width()
.
This function will be called for each row in the trace which is being used, and all other
rows in the trace will be filled with zeroes.Source§fn generate_public_values(&self) -> Vec<F>
fn generate_public_values(&self) -> Vec<F>
Returns a list of public values to publish.
fn air(&self) -> &Self::Air
Source§fn finalize(&self, _trace: &mut RowMajorMatrix<F>, _num_records: usize)
fn finalize(&self, _trace: &mut RowMajorMatrix<F>, _num_records: usize)
Finalize the trace, especially the padded rows if the all-zero rows don’t satisfy the constraints.
This is done after records are consumed and the trace matrix is generated.
Most implementations should just leave the default implementation if padding with rows of all 0s satisfies the constraints.
Auto Trait Implementations§
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> Freeze for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> RefUnwindSafe for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>where
T: RefUnwindSafe,
PI: RefUnwindSafe,
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> Send for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> Sync for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> Unpin for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>
impl<T, PI, const NUM_READS: usize, const NUM_WRITES: usize, const READ_SIZE: usize, const WRITE_SIZE: usize> UnwindSafe for BasicAdapterInterface<T, PI, NUM_READS, NUM_WRITES, READ_SIZE, WRITE_SIZE>where
T: UnwindSafe,
PI: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.