pub struct CpuBackend<SC: StarkProtocolConfig>(/* private fields */);Expand description
Row-major CPU prover backend.
Uses RowMajorMatrix<SC::F> as the matrix type for better cache locality
during constraint evaluation.
Implementations§
Source§impl<SC: StarkProtocolConfig> CpuBackend<SC>
impl<SC: StarkProtocolConfig> CpuBackend<SC>
Trait Implementations§
Source§impl<SC: Clone + StarkProtocolConfig> Clone for CpuBackend<SC>
impl<SC: Clone + StarkProtocolConfig> Clone for CpuBackend<SC>
Source§fn clone(&self) -> CpuBackend<SC>
fn clone(&self) -> CpuBackend<SC>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<SC: Copy + StarkProtocolConfig> Copy for CpuBackend<SC>
Source§impl<SC: StarkProtocolConfig> Default for CpuBackend<SC>
impl<SC: StarkProtocolConfig> Default for CpuBackend<SC>
Source§impl<SC: StarkProtocolConfig> DeviceDataTransporter<SC, CpuBackend<SC>> for CpuDevice<SC>
impl<SC: StarkProtocolConfig> DeviceDataTransporter<SC, CpuBackend<SC>> for CpuDevice<SC>
Source§fn transport_pk_to_device(
&self,
mpk: &MultiStarkProvingKey<SC>,
) -> DeviceMultiStarkProvingKey<CpuBackend<SC>>
fn transport_pk_to_device( &self, mpk: &MultiStarkProvingKey<SC>, ) -> DeviceMultiStarkProvingKey<CpuBackend<SC>>
Transport the proving key to the device, filtering for only the provided
air_ids.fn transport_matrix_to_device( &self, matrix: &ColMajorMatrix<SC::F>, ) -> RowMajorMatrix<SC::F>
Source§fn transport_pcs_data_to_device(
&self,
pcs_data: &StackedPcsData<SC::F, SC::Digest>,
) -> CpuStackedPcsData<SC::F, SC::Digest>
fn transport_pcs_data_to_device( &self, pcs_data: &StackedPcsData<SC::F, SC::Digest>, ) -> CpuStackedPcsData<SC::F, SC::Digest>
The
commitment and prover_data are assumed to have been previously computed from the
trace.Source§fn transport_matrix_from_device_to_host(
&self,
matrix: &RowMajorMatrix<SC::F>,
) -> ColMajorMatrix<SC::F>
fn transport_matrix_from_device_to_host( &self, matrix: &RowMajorMatrix<SC::F>, ) -> ColMajorMatrix<SC::F>
Transport a device matrix to host. This should only be used for testing / debugging
purposes.
fn transport_committed_trace_data_to_device( &self, committed_trace: &CommittedTraceData<CpuColMajorBackend<SC>>, ) -> CommittedTraceData<PB>
fn transport_proving_ctx_to_device( &self, ctx: &ProvingContext<CpuColMajorBackend<SC>>, ) -> ProvingContext<PB>
Source§impl<SC, TS> MultiRapProver<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::EF: TwoAdicField + ExtensionField<SC::F>,
TS: FiatShamirTranscript<SC>,
impl<SC, TS> MultiRapProver<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::EF: TwoAdicField + ExtensionField<SC::F>,
TS: FiatShamirTranscript<SC>,
Source§type PartialProof = (GkrProof<SC>, BatchConstraintProof<SC>)
type PartialProof = (GkrProof<SC>, BatchConstraintProof<SC>)
The partial proof is the proof that the trace matrices satisfy all constraints assuming that
certain polynomial opening claims are validated. In other words, it is a proof that reduces
the constraint satisfaction claim to certain polynomial opening claims.
Source§type Artifacts = Vec<<SC as StarkProtocolConfig>::EF>
type Artifacts = Vec<<SC as StarkProtocolConfig>::EF>
Other artifacts of the proof (e.g., sampled randomness) that may be passed to later stages
of the protocol.
type Error = CpuProverError
fn prove_rap_constraints( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<CpuBackend<SC>>, ctx: &ProvingContext<CpuBackend<SC>>, _common_main_pcs_data: &CpuStackedPcsData<SC::F, SC::Digest>, ) -> Result<((GkrProof<SC>, BatchConstraintProof<SC>), Vec<SC::EF>), Self::Error>
Source§impl<SC, TS> OpeningProver<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::F: Ord,
SC::EF: TwoAdicField + ExtensionField<SC::F> + Ord,
TS: FiatShamirTranscript<SC>,
impl<SC, TS> OpeningProver<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::F: Ord,
SC::EF: TwoAdicField + ExtensionField<SC::F> + Ord,
TS: FiatShamirTranscript<SC>,
Source§type OpeningProof = (StackingProof<SC>, WhirProof<SC>)
type OpeningProof = (StackingProof<SC>, WhirProof<SC>)
PCS opening proof on host. This should not be a reference.
type OpeningPoints = Vec<<SC as StarkProtocolConfig>::EF>
Source§type Error = CpuProverError
type Error = CpuProverError
Computes the opening proof.
The
common_main_pcs_data is the PcsData for the collection of common main trace
matrices. It is owned by the function and may be mutated.
The pre_cached_pcs_data_per_commit is the PcsData for the preprocessed and cached trace
matrices. These are specified by their PcsData per commitment.fn prove_openings( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<CpuBackend<SC>>, ctx: ProvingContext<CpuBackend<SC>>, common_main_pcs_data: CpuStackedPcsData<SC::F, SC::Digest>, r: Vec<SC::EF>, ) -> Result<(StackingProof<SC>, WhirProof<SC>), Self::Error>
Source§impl<SC: StarkProtocolConfig> ProverBackend for CpuBackend<SC>
impl<SC: StarkProtocolConfig> ProverBackend for CpuBackend<SC>
Source§const CHALLENGE_EXT_DEGREE: u8
const CHALLENGE_EXT_DEGREE: u8
Extension field degree for the challenge field
Self::Challenge over base field
Self::Val.Source§type Val = <SC as StarkProtocolConfig>::F
type Val = <SC as StarkProtocolConfig>::F
Base field type, on host.
Source§type Challenge = <SC as StarkProtocolConfig>::EF
type Challenge = <SC as StarkProtocolConfig>::EF
Challenge field (extension field of base field), on host.
Source§type Commitment = <SC as StarkProtocolConfig>::Digest
type Commitment = <SC as StarkProtocolConfig>::Digest
Single commitment on host.
Source§type Matrix = DenseMatrix<<SC as StarkProtocolConfig>::F>
type Matrix = DenseMatrix<<SC as StarkProtocolConfig>::F>
Single matrix buffer on device together with dimension metadata. Owning this means nothing
else has a shared reference to the buffer.
Source§type OtherAirData = ()
type OtherAirData = ()
Backend specific type for any pre-computed data associated with a single AIR. For example,
it may contain prover-specific precomputations based on the AIR constraints (but
independent from any trace data).
Source§type PcsData = CpuStackedPcsData<<SC as StarkProtocolConfig>::F, <SC as StarkProtocolConfig>::Digest>
type PcsData = CpuStackedPcsData<<SC as StarkProtocolConfig>::F, <SC as StarkProtocolConfig>::Digest>
Owned buffer for the preimage of a PCS commitment on device, together with any metadata
necessary for computing opening proofs. Read more
Source§impl<SC, TS> ProverDevice<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::F: Ord,
SC::EF: TwoAdicField + ExtensionField<SC::F> + Ord,
TS: FiatShamirTranscript<SC>,
impl<SC, TS> ProverDevice<CpuBackend<SC>, TS> for CpuDevice<SC>where
SC: StarkProtocolConfig,
SC::F: Ord,
SC::EF: TwoAdicField + ExtensionField<SC::F> + Ord,
TS: FiatShamirTranscript<SC>,
Auto Trait Implementations§
impl<SC> Freeze for CpuBackend<SC>
impl<SC> RefUnwindSafe for CpuBackend<SC>where
SC: RefUnwindSafe,
impl<SC> Send for CpuBackend<SC>
impl<SC> Sync for CpuBackend<SC>
impl<SC> Unpin for CpuBackend<SC>where
SC: Unpin,
impl<SC> UnsafeUnpin for CpuBackend<SC>
impl<SC> UnwindSafe for CpuBackend<SC>where
SC: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more