Skip to content

Commit

Permalink
more tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Mar 5, 2025
2 parents ec8b5c5 + 254e92f commit e8d35e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mpcs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ plonky2.workspace = true
poseidon.workspace = true
rand.workspace = true
rand_chacha.workspace = true
tracing.workspace = true
rayon = { workspace = true, optional = true }
serde.workspace = true
transcript = { path = "../transcript" }
whir = { path = "../whir", features = ["ceno"] }
witness = { path = "../witness" }
ceno_sumcheck = { path = "../sumcheck", package = "sumcheck" }
zeroize = "1.8"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion mpcs/benches/whir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn bench_commit_open_verify_goldilocks<Pcs: PolynomialCommitmentScheme<E>>(c: &m

let mut transcript = T::new(b"BaseFold");
let rmm = RowMajorMatrix::rand(&mut OsRng, 1 << num_vars, 1);
let poly = rmm.to_mles().remove(0);
let poly: ArcMultilinearExtension<_> = rmm.to_mles().remove(0).into();
let comm = Pcs::commit_and_write(&pp, rmm, &mut transcript).unwrap();

group.bench_function(BenchmarkId::new("commit", format!("{}", num_vars)), |b| {
Expand Down
8 changes: 7 additions & 1 deletion mpcs/src/basefold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::{
validate_input,
};
use ark_std::{end_timer, start_timer};
use ceno_sumcheck::macros::{entered_span, exit_span};
pub use encoding::{
Basecode, BasecodeDefaultSpec, EncodingProverParameters, EncodingScheme, RSCode,
RSCodeDefaultSpec,
Expand Down Expand Up @@ -345,7 +346,9 @@ where
pp: &Self::ProverParam,
rmm: witness::RowMajorMatrix<<E as ff_ext::ExtensionField>::BaseField>,
) -> Result<Self::CommitmentWithWitness, Error> {
let span = entered_span!("to_mles", profiling_3 = true);
let polys = rmm.to_mles();
exit_span!(span);
// assumptions
// 1. there must be at least one polynomial
// 2. all polynomials must exist in the same field type
Expand Down Expand Up @@ -376,12 +379,15 @@ where
let timer = start_timer!(|| "Basefold::batch commit");

let encode_timer = start_timer!(|| "Basefold::batch commit::encoding and interpolations");
let span = entered_span!("encode_codeword_and_mle", profiling_3 = true);
let evals_codewords = polys
.par_iter()
.map(|poly| Self::get_poly_bh_evals_and_codeword(pp, poly))
.collect::<Vec<PolyEvalsCodeword<E>>>();
exit_span!(span);
end_timer!(encode_timer);

let span = entered_span!("build mt", profiling_3 = true);
// build merkle tree from leaves
let ret = match evals_codewords[0] {
PolyEvalsCodeword::Normal(_) => {
Expand Down Expand Up @@ -436,7 +442,7 @@ where
}
PolyEvalsCodeword::TooBig(num_vars) => return Err(Error::PolynomialTooLarge(num_vars)),
};

exit_span!(span);
end_timer!(timer);

Ok(ret)
Expand Down
1 change: 0 additions & 1 deletion mpcs/src/basefold/commit_phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ where
FieldType::Ext(basecode) => basecode,
_ => panic!("Should be ext field"),
};

let mut new_running_oracle = new_running_oracle;
reverse_index_bits_in_place(&mut new_running_oracle);
assert_eq!(basecode, new_running_oracle);
Expand Down

0 comments on commit e8d35e4

Please sign in to comment.