Skip to content

Commit

Permalink
o1vm/pickles: Add debugging duration in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzixnerd committed Oct 28, 2024
1 parent a494251 commit 772fee6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion o1vm/src/pickles/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Instant;

use super::{
super::interpreters::mips::witness::SCRATCH_SIZE,
proof::{ProofInputs, WitnessColumns},
Expand All @@ -13,6 +15,7 @@ use ark_ff::{One, Zero};
use interpreter::{ITypeInstruction, JTypeInstruction, RTypeInstruction};
use kimchi::circuits::{domains::EvaluationDomains, expr::Expr, gate::CurrOrNext};
use kimchi_msm::{columns::Column, expr::E};
use log::debug;
use mina_curves::pasta::{Fp, Fq, Pallas, PallasParameters};
use mina_poseidon::{
constants::PlonkSpongeConstantsKimchi,
Expand Down Expand Up @@ -89,11 +92,12 @@ fn test_small_circuit() {
selector: zero_to_n_minus_one(8),
},
};
let mut expr = Expr::literal(Fq::zero());
let mut expr = Expr::zero();
for i in 0..SCRATCH_SIZE + 2 {
expr += Expr::cell(Column::Relation(i), CurrOrNext::Curr);
}
let mut rng = make_test_rng(None);

type BaseSponge = DefaultFqSponge<PallasParameters, PlonkSpongeConstantsKimchi>;
type ScalarSponge = DefaultFrSponge<Fq, PlonkSpongeConstantsKimchi>;

Expand All @@ -106,7 +110,10 @@ fn test_small_circuit() {
)
.unwrap();

let instant_before_verification = Instant::now();
let verif =
verify::<Pallas, BaseSponge, ScalarSponge>(domain, &srs, &vec![expr.clone()], &proof);
let instant_after_verification = Instant::now();
debug!("Verification took: {}", (instant_after_verification - instant_before_verification).as_millis());
assert!(verif, "Verification fails");
}

0 comments on commit 772fee6

Please sign in to comment.