Skip to content

Commit

Permalink
Frame-like M now is an associated type (#1136)
Browse files Browse the repository at this point in the history
* Frame-like M now is an associated type

* `M` -> `Frame` rename
  • Loading branch information
gabriel-barrett authored Feb 15, 2024
1 parent 05ddf4e commit 5190371
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ impl FoldingMode {
}

/// A trait for a prover that works with a field `F`.
pub trait Prover<'a, F: CurveCycleEquipped, M: FrameLike<Ptr, FrameIO = Vec<Ptr>>> {
pub trait Prover<'a, F: CurveCycleEquipped> {
/// Associated type for a frame-like datatype
type Frame: FrameLike<Ptr, FrameIO = Vec<Ptr>>;

/// Associated type for public parameters
type PublicParams;

/// Associated proof type, which must implement `RecursiveSNARKTrait`
type RecursiveSnark: RecursiveSNARKTrait<F, M, PublicParams = Self::PublicParams>;
type RecursiveSnark: RecursiveSNARKTrait<F, Self::Frame, PublicParams = Self::PublicParams>;

/// Returns a reference to the prover's FoldingMode
fn folding_mode(&self) -> &FoldingMode;
Expand All @@ -166,7 +169,7 @@ pub trait Prover<'a, F: CurveCycleEquipped, M: FrameLike<Ptr, FrameIO = Vec<Ptr>
fn prove(
&self,
pp: &Self::PublicParams,
steps: Vec<M>,
steps: Vec<Self::Frame>,
store: &'a Store<F>,
) -> Result<(Self::RecursiveSnark, Vec<F>, Vec<F>, usize), ProofError> {
store.hydrate_z_cache();
Expand Down
5 changes: 2 additions & 3 deletions src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,8 @@ impl<'a, F: CurveCycleEquipped, C: Coprocessor<F> + 'a> NovaProver<'a, F, C> {
}
}

impl<'a, F: CurveCycleEquipped, C: Coprocessor<F> + 'a> Prover<'a, F, C1LEM<'a, F, C>>
for NovaProver<'a, F, C>
{
impl<'a, F: CurveCycleEquipped, C: Coprocessor<F> + 'a> Prover<'a, F> for NovaProver<'a, F, C> {
type Frame = C1LEM<'a, F, C>;
type PublicParams = PublicParams<F>;
type RecursiveSnark = Proof<F, C1LEM<'a, F, C>>;

Expand Down
5 changes: 2 additions & 3 deletions src/proof/supernova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,8 @@ impl<'a, F: CurveCycleEquipped, C: Coprocessor<F>> RecursiveSNARKTrait<F, C1LEM<
}
}

impl<'a, F: CurveCycleEquipped, C: Coprocessor<F>> Prover<'a, F, C1LEM<'a, F, C>>
for SuperNovaProver<'a, F, C>
{
impl<'a, F: CurveCycleEquipped, C: Coprocessor<F>> Prover<'a, F> for SuperNovaProver<'a, F, C> {
type Frame = C1LEM<'a, F, C>;
type PublicParams = PublicParams<F>;
type RecursiveSnark = Proof<F, C1LEM<'a, F, C>>;

Expand Down

1 comment on commit 5190371

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Table of Contents

Overview

This benchmark report shows the Fibonacci GPU benchmark.
NVIDIA L4
Intel(R) Xeon(R) CPU @ 2.20GHz
32 vCPUs
125 GB RAM
Workflow run: https://github.com/lurk-lab/lurk-rs/actions/runs/7921652386

Benchmark Results

LEM Fibonacci Prove - rc = 100

ref=05ddf4e4649a9cb4bb10796303b076f94d6fe740 ref=51903719a1c5e54692a63f70c65a31c6b9922286
num-100 1.47 s (✅ 1.00x) 1.47 s (✅ 1.00x slower)
num-200 2.80 s (✅ 1.00x) 2.79 s (✅ 1.00x faster)

LEM Fibonacci Prove - rc = 600

ref=05ddf4e4649a9cb4bb10796303b076f94d6fe740 ref=51903719a1c5e54692a63f70c65a31c6b9922286
num-100 1.83 s (✅ 1.00x) 1.86 s (✅ 1.02x slower)
num-200 3.03 s (✅ 1.00x) 3.08 s (✅ 1.02x slower)

Made with criterion-table

Please sign in to comment.