From 8ad3d09419eb873e93d8a9c0d20e2b1d415e1225 Mon Sep 17 00:00:00 2001 From: kunxian xia Date: Thu, 19 Sep 2024 17:50:37 +0800 Subject: [PATCH 01/11] add mpcs in cargo clippy --- Makefile.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index 60864bade..0cc0e844c 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -25,4 +25,4 @@ args = ["fmt", "-p", "ceno_zkvm", "--", "--check"] [tasks.clippy-check-selected-packages] command = "cargo" -args = ["clippy", "-p", "ceno_zkvm", "--target", "${TARGET}", "--", "-D", "warnings"] +args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "--target", "${TARGET}", "--", "-D", "warnings"] From 24d163c0cd2410ea0221b84ae10877b10bf36ae1 Mon Sep 17 00:00:00 2001 From: Yuncong Zhang Date: Fri, 20 Sep 2024 16:17:18 +0800 Subject: [PATCH 02/11] Fix clippy errors --- mpcs/src/basefold.rs | 24 ++++++++++++------------ mpcs/src/basefold/commit_phase.rs | 12 ++++++------ mpcs/src/basefold/query_phase.rs | 5 ++++- mpcs/src/basefold/structure.rs | 8 ++++---- mpcs/src/sum_check.rs | 8 +++++++- mpcs/src/util/merkle_tree.rs | 20 ++++++++++---------- 6 files changed, 43 insertions(+), 34 deletions(-) diff --git a/mpcs/src/basefold.rs b/mpcs/src/basefold.rs index 43ea33570..716bfb2e0 100644 --- a/mpcs/src/basefold.rs +++ b/mpcs/src/basefold.rs @@ -945,13 +945,13 @@ where verifier_query_phase::( queries.as_slice(), &vp.encoding_params, - &query_result_with_merkle_path, - &sumcheck_messages, + query_result_with_merkle_path, + sumcheck_messages, &fold_challenges, num_rounds, num_vars, - &final_message, - &roots, + final_message, + roots, comm, eq.as_slice(), eval, @@ -1074,13 +1074,13 @@ where batch_verifier_query_phase::( queries.as_slice(), &vp.encoding_params, - &query_result_with_merkle_path, - &sumcheck_messages, + query_result_with_merkle_path, + sumcheck_messages, &fold_challenges, num_rounds, num_vars, - &final_message, - &roots, + final_message, + roots, &comms, &coeffs, eq.as_slice(), @@ -1176,14 +1176,14 @@ where simple_batch_verifier_query_phase::( queries.as_slice(), &vp.encoding_params, - &query_result_with_merkle_path, - &sumcheck_messages, + query_result_with_merkle_path, + sumcheck_messages, &fold_challenges, &eq_xt, num_rounds, num_vars, - &final_message, - &roots, + final_message, + roots, comm, eq.as_slice(), evals, diff --git a/mpcs/src/basefold/commit_phase.rs b/mpcs/src/basefold/commit_phase.rs index 9cdf45f52..5566bf527 100644 --- a/mpcs/src/basefold/commit_phase.rs +++ b/mpcs/src/basefold/commit_phase.rs @@ -167,14 +167,14 @@ where end_timer!(sumcheck_timer); } end_timer!(timer); - return ( + ( trees, BasefoldCommitPhaseProof { sumcheck_messages, roots, final_message, }, - ); + ) } // outputs (trees, sumcheck_oracles, oracles, bh_evals, eq, eval) @@ -341,14 +341,14 @@ where end_timer!(sumcheck_timer); } end_timer!(timer); - return ( + ( trees, BasefoldCommitPhaseProof { sumcheck_messages, roots, final_message, }, - ); + ) } // outputs (trees, sumcheck_oracles, oracles, bh_evals, eq, eval) @@ -484,14 +484,14 @@ where end_timer!(sumcheck_timer); } end_timer!(timer); - return ( + ( trees, BasefoldCommitPhaseProof { sumcheck_messages, roots, final_message, }, - ); + ) } fn basefold_one_round_by_interpolation_weights>( diff --git a/mpcs/src/basefold/query_phase.rs b/mpcs/src/basefold/query_phase.rs index a1c16d8dc..f4045550f 100644 --- a/mpcs/src/basefold/query_phase.rs +++ b/mpcs/src/basefold/query_phase.rs @@ -147,7 +147,7 @@ pub fn verifier_query_phase>( num_rounds: usize, num_vars: usize, final_message: &[E], - roots: &Vec>, + roots: &[Digest], comm: &BasefoldCommitment, partial_eq: &[E], eval: &E, @@ -915,6 +915,7 @@ where let mut right_index = index | 1; let mut left_index = right_index - 1; + #[allow(clippy::needless_range_loop)] for i in 0..num_rounds { let (x0, x1, w) = >::verifier_folding_coeffs( vp, @@ -1111,6 +1112,7 @@ where let mut right_index = index | 1; let mut left_index = right_index - 1; + #[allow(clippy::needless_range_loop)] for i in 0..num_rounds { // let round_timer = start_timer!(|| format!("BatchedSingleQueryResult::round {}", i)); let matching_comms = comms @@ -1448,6 +1450,7 @@ where let mut right_index = index | 1; let mut left_index = right_index - 1; + #[allow(clippy::needless_range_loop)] for i in 0..num_rounds { // let round_timer = start_timer!(|| format!("SingleQueryResult::round {}", i)); diff --git a/mpcs/src/basefold/structure.rs b/mpcs/src/basefold/structure.rs index e3ca7d9c7..bafc50c22 100644 --- a/mpcs/src/basefold/structure.rs +++ b/mpcs/src/basefold/structure.rs @@ -294,21 +294,21 @@ impl ProofQueriesResultWithMerklePath where E::BaseField: Serialize + DeserializeOwned, { - pub fn as_single<'a>(&'a self) -> &'a QueriesResultWithMerklePath { + pub fn as_single(&self) -> &QueriesResultWithMerklePath { match self { Self::Single(x) => x, _ => panic!("Not a single query result"), } } - pub fn as_batched<'a>(&'a self) -> &'a BatchedQueriesResultWithMerklePath { + pub fn as_batched(&self) -> &BatchedQueriesResultWithMerklePath { match self { Self::Batched(x) => x, _ => panic!("Not a batched query result"), } } - pub fn as_simple_batched<'a>(&'a self) -> &'a SimpleBatchQueriesResultWithMerklePath { + pub fn as_simple_batched(&self) -> &SimpleBatchQueriesResultWithMerklePath { match self { Self::SimpleBatched(x) => x, _ => panic!("Not a simple batched query result"), @@ -347,7 +347,7 @@ where } pub fn is_trivial(&self) -> bool { - self.trivial_proof.len() > 0 + !self.trivial_proof.is_empty() } } diff --git a/mpcs/src/sum_check.rs b/mpcs/src/sum_check.rs index a3e1b460c..787d7fca1 100644 --- a/mpcs/src/sum_check.rs +++ b/mpcs/src/sum_check.rs @@ -42,6 +42,12 @@ impl<'a, E: ExtensionField> VirtualPolynomial<'a, E> { } } +pub type SumCheckProverOutput = ( + Vec, + Vec, + SumcheckProof>::RoundMessage>, +); + pub trait SumCheck: Clone + Debug where E::BaseField: Serialize + DeserializeOwned, @@ -56,7 +62,7 @@ where virtual_poly: VirtualPolynomial, sum: E, transcript: &mut Transcript, - ) -> Result<(Vec, Vec, SumcheckProof), Error>; + ) -> Result, Error>; fn verify( vp: &Self::VerifierParam, diff --git a/mpcs/src/util/merkle_tree.rs b/mpcs/src/util/merkle_tree.rs index a195c678c..94186fb0b 100644 --- a/mpcs/src/util/merkle_tree.rs +++ b/mpcs/src/util/merkle_tree.rs @@ -40,24 +40,24 @@ where leaves: &FieldType, hasher: &Hasher, ) -> Vec>> { - merkelize::(&[&leaves], hasher) + merkelize::(&[leaves], hasher) } pub fn compute_inner_base( leaves: &Vec, hasher: &Hasher, ) -> Vec>> { - merkelize_base::(&[&leaves], hasher) + merkelize_base::(&[leaves], hasher) } pub fn compute_inner_ext( leaves: &Vec, hasher: &Hasher, ) -> Vec>> { - merkelize_ext::(&[&leaves], hasher) + merkelize_ext::(&[leaves], hasher) } - pub fn root_from_inner(inner: &Vec>>) -> Digest { + pub fn root_from_inner(inner: &[Vec>]) -> Digest { inner.last().unwrap()[0].clone() } @@ -299,12 +299,12 @@ fn merkelize( hashes.par_iter_mut().enumerate().for_each(|(i, hash)| { *hash = match &values[0] { FieldType::Base(_) => hash_two_leaves_batch_base::( - &values + values .iter() .map(|values| field_type_index_base(values, i << 1)) .collect_vec() .as_slice(), - &values + values .iter() .map(|values| field_type_index_base(values, (i << 1) + 1)) .collect_vec() @@ -363,12 +363,12 @@ fn merkelize_base( } else { hashes.par_iter_mut().enumerate().for_each(|(i, hash)| { *hash = hash_two_leaves_batch_base::( - &values + values .iter() .map(|values| values[i << 1]) .collect_vec() .as_slice(), - &values + values .iter() .map(|values| values[(i << 1) + 1]) .collect_vec() @@ -412,12 +412,12 @@ fn merkelize_ext( } else { hashes.par_iter_mut().enumerate().for_each(|(i, hash)| { *hash = hash_two_leaves_batch_ext::( - &values + values .iter() .map(|values| values[i << 1]) .collect_vec() .as_slice(), - &values + values .iter() .map(|values| values[(i << 1) + 1]) .collect_vec() From f86a28cb509843d969dc89a446ab03fb949e8179 Mon Sep 17 00:00:00 2001 From: kunxian xia Date: Fri, 20 Sep 2024 16:39:00 +0800 Subject: [PATCH 03/11] clippy over all targets --- Makefile.toml | 2 +- ceno_emul/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 0cc0e844c..5e36a843d 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -25,4 +25,4 @@ args = ["fmt", "-p", "ceno_zkvm", "--", "--check"] [tasks.clippy-check-selected-packages] command = "cargo" -args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "--target", "${TARGET}", "--", "-D", "warnings"] +args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "-p", "ceno_emul", "-p", "ceno_rt", "--all-targets", "--", "-D", "warnings"] diff --git a/ceno_emul/src/lib.rs b/ceno_emul/src/lib.rs index 8a21a0ac2..b9cfd9724 100644 --- a/ceno_emul/src/lib.rs +++ b/ceno_emul/src/lib.rs @@ -11,7 +11,7 @@ mod vm_state; pub use vm_state::VMState; mod rv32im; -pub use rv32im::{DecodedInstruction, EmuContext, InsnCodes, InsnCategory, InsnKind}; +pub use rv32im::{DecodedInstruction, EmuContext, InsnCategory, InsnCodes, InsnKind}; mod elf; pub use elf::Program; From 17dfe28645cdf552962838220d2824970f945edf Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 15:53:51 +0800 Subject: [PATCH 04/11] cleanup unused dependency in mpcs --- Cargo.lock | 2 -- mpcs/Cargo.toml | 2 -- 2 files changed, 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f87fc142f..088adf45d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1172,7 +1172,6 @@ dependencies = [ "ff", "ff_ext", "generic-array", - "gkr", "goldilocks", "halo2curves 0.3.3", "itertools 0.12.1", @@ -1186,7 +1185,6 @@ dependencies = [ "rayon", "serde", "sha3", - "simple-frontend", "transcript", ] diff --git a/mpcs/Cargo.toml b/mpcs/Cargo.toml index 0b6b0661c..ddc880ca9 100644 --- a/mpcs/Cargo.toml +++ b/mpcs/Cargo.toml @@ -34,8 +34,6 @@ transcript = { path = "../transcript" } plonky2 = "0.2.0" [dev-dependencies] -simple-frontend = { path = "../simple-frontend" } -gkr = { path = "../gkr" } criterion = { version = "0.5", features = ["html_reports"] } [features] From 9b9af39fb37bb56561fe8ce50d72472a09ec77d5 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 16:15:08 +0800 Subject: [PATCH 05/11] check specific target and clippy fix --- Makefile.toml | 2 +- ceno_emul/src/rv32im.rs | 1 + ceno_emul/tests/test_vm_trace.rs | 1 + ceno_rt/src/io.rs | 3 +++ ceno_rt/src/lib.rs | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index 5e36a843d..7feddbd14 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -25,4 +25,4 @@ args = ["fmt", "-p", "ceno_zkvm", "--", "--check"] [tasks.clippy-check-selected-packages] command = "cargo" -args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "-p", "ceno_emul", "-p", "ceno_rt", "--all-targets", "--", "-D", "warnings"] +args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "-p", "ceno_emul", "-p", "ceno_rt", "--target", "${TARGET}", "--", "-D", "warnings"] diff --git a/ceno_emul/src/rv32im.rs b/ceno_emul/src/rv32im.rs index 86c7c71cb..42a97a27d 100644 --- a/ceno_emul/src/rv32im.rs +++ b/ceno_emul/src/rv32im.rs @@ -377,6 +377,7 @@ impl DecodedInstruction { #[cfg(test)] #[test] +#[allow(clippy::identity_op)] fn test_decode_imm() { for (i, expected) in [ // Example of I-type: ADDI. diff --git a/ceno_emul/tests/test_vm_trace.rs b/ceno_emul/tests/test_vm_trace.rs index 86cb7420b..06fb4203a 100644 --- a/ceno_emul/tests/test_vm_trace.rs +++ b/ceno_emul/tests/test_vm_trace.rs @@ -1,3 +1,4 @@ +#![allow(clippy::unusual_byte_groupings)] use anyhow::Result; use std::collections::HashMap; diff --git a/ceno_rt/src/io.rs b/ceno_rt/src/io.rs index 61636e233..3b0e0205b 100644 --- a/ceno_rt/src/io.rs +++ b/ceno_rt/src/io.rs @@ -23,6 +23,9 @@ impl IOWriter { } } + // TODO docs on why design mut_from_ref + // or justify this convention by citing from other place + #[allow(clippy::mut_from_ref)] pub fn alloc(&self, count: usize) -> &mut [T] { let byte_len = count * size_of::(); let word_len = byte_len.div_ceil(WORD_SIZE); diff --git a/ceno_rt/src/lib.rs b/ceno_rt/src/lib.rs index a79ebefb8..03bb27a91 100644 --- a/ceno_rt/src/lib.rs +++ b/ceno_rt/src/lib.rs @@ -21,6 +21,7 @@ mod panic_handler { } } +#[allow(asm_sub_register)] pub fn halt(exit_code: u32) -> ! { unsafe { asm!( From 2fba96127f153adffc9adde25016a4b9435ac08b Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 16:26:09 +0800 Subject: [PATCH 06/11] friendly for environ other than github ci --- .github/workflows/lints.yml | 4 ++-- Makefile.toml | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 7215344be..d1168a067 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -63,7 +63,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: make - args: fmt-check-selected-packages + args: fmt - name: Run clippy uses: actions-rs/cargo@v1 @@ -71,5 +71,5 @@ jobs: TARGET: ${{ matrix.target }} with: command: make - args: clippy-check-selected-packages + args: clippy diff --git a/Makefile.toml b/Makefile.toml index 7feddbd14..f4748e96d 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -2,27 +2,37 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true CORE = { script = ["grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}'"] } RAYON_NUM_THREADS = "${CORE}" +CUR_TARGET = { script = [ + # Command to check if the variable is not set, then assign output of the bash command + ''' + if [ -z "${TARGET}" ]; then + echo "x86_64-unknown-linux-gnu" + else + echo "${TARGET}" + fi + ''' +]} [tasks.tests] command = "cargo" -args = ["test", "--lib", "--release", "--target", "${TARGET}", "--workspace", "--exclude", "singer-pro", "--exclude", "ceno_rt"] +args = ["test", "--lib", "--release", "--target", "${CUR_TARGET}", "--workspace", "--exclude", "singer-pro", "--exclude", "ceno_rt"] [tasks.fmt-check] command = "cargo" args = ["fmt", "--all", "--", "--check"] -[tasks.fmt] +[tasks.fmt-all] command = "cargo" args = ["fmt", "--all"] -[tasks.clippy] +[tasks.clippy-all] command = "cargo" args = ["clippy", "--all-features", "--all-targets", "--", "-D", "warnings"] -[tasks.fmt-check-selected-packages] +[tasks.fmt] command = "cargo" args = ["fmt", "-p", "ceno_zkvm", "--", "--check"] -[tasks.clippy-check-selected-packages] +[tasks.clippy] command = "cargo" -args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "-p", "ceno_emul", "-p", "ceno_rt", "--target", "${TARGET}", "--", "-D", "warnings"] +args = ["clippy", "-p", "ceno_zkvm", "-p", "mpcs", "-p", "ceno_emul", "-p", "ceno_rt", "--target", "${CUR_TARGET}", "--", "-D", "warnings"] From aedc69eb732b415d459966545073a98f541ab508 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 16:30:33 +0800 Subject: [PATCH 07/11] support all kind of local development env --- Makefile.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index f4748e96d..36abf09be 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -6,7 +6,8 @@ CUR_TARGET = { script = [ # Command to check if the variable is not set, then assign output of the bash command ''' if [ -z "${TARGET}" ]; then - echo "x86_64-unknown-linux-gnu" + TARGET=$(rustc -vV | grep "host" | awk '{print $2}') + echo "${TARGET}" else echo "${TARGET}" fi From b5de64403e3e603c8d144446158982b00ec3dc5b Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 16:49:08 +0800 Subject: [PATCH 08/11] skip riv64 to accelerate ci testing --- Cargo.toml | 3 +++ Makefile.toml | 4 ++-- ceno_zkvm/Cargo.toml | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a5bd699c1..32927f35e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,5 +37,8 @@ rand_xorshift = "0.3" rayon = "1.8" rand_chacha = { version = "0.3.1", features = ["serde1"] } +[workspace.dev-dependencies] +cargo-all-features = "1.10.0" + [patch."https://github.com/zhenfeizhang/Goldilocks"] goldilocks = { git = "https://github.com/hero78119/Goldilocks" } diff --git a/Makefile.toml b/Makefile.toml index 36abf09be..303bc7955 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -16,9 +16,9 @@ CUR_TARGET = { script = [ [tasks.tests] command = "cargo" -args = ["test", "--lib", "--release", "--target", "${CUR_TARGET}", "--workspace", "--exclude", "singer-pro", "--exclude", "ceno_rt"] +args = ["test-all-features", "--lib", "--release", "--target", "${CUR_TARGET}", "--workspace", "--exclude", "singer-pro", "--exclude", "ceno_rt"] -[tasks.fmt-check] +[tasks.fmt-all-check] command = "cargo" args = ["fmt", "--all", "--", "--check"] diff --git a/ceno_zkvm/Cargo.toml b/ceno_zkvm/Cargo.toml index ce7c9bf59..d97a3fc54 100644 --- a/ceno_zkvm/Cargo.toml +++ b/ceno_zkvm/Cargo.toml @@ -42,6 +42,13 @@ const_env = "0.1.2" serde_json = "1.0.108" base64 = "0.22.1" + +[package.metadata.cargo-all-features] +skip_feature_sets = [ + ["riv64"], +] + + [build-dependencies] glob = "0.3" From 93eeadc84031b13827fd6d7634e9a982cbc9f12e Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 16:54:21 +0800 Subject: [PATCH 09/11] install cargo-all-features on ci --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5a51be8c1..410fd466d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,6 +54,9 @@ jobs: - name: Install cargo make run: | cargo install cargo-make || echo "cargo-make already installed" + - name: Install cargo-all-features + run: | + cargo install cargo-all-features || echo "cargo-all-features already installed" - name: run test uses: actions-rs/cargo@v1 env: From 6aac3703292193d3e796d6f886392e29e621f3a8 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 17:02:46 +0800 Subject: [PATCH 10/11] delete unused dep --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 32927f35e..a5bd699c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,8 +37,5 @@ rand_xorshift = "0.3" rayon = "1.8" rand_chacha = { version = "0.3.1", features = ["serde1"] } -[workspace.dev-dependencies] -cargo-all-features = "1.10.0" - [patch."https://github.com/zhenfeizhang/Goldilocks"] goldilocks = { git = "https://github.com/hero78119/Goldilocks" } From 68f407b1284af02b0a1e5e8dd6617b7798d1b9df Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 26 Sep 2024 17:40:40 +0800 Subject: [PATCH 11/11] resolve workspace test run multiple time issue rewrite cargo make tests to avoid run same test multiple times wip simplify design test --- .github/workflows/tests.yml | 3 --- Cargo.lock | 2 ++ Makefile.toml | 16 ++++++++++++++-- ceno_zkvm/Cargo.toml | 7 ------- mpcs/Cargo.toml | 2 ++ 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 410fd466d..5a51be8c1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,9 +54,6 @@ jobs: - name: Install cargo make run: | cargo install cargo-make || echo "cargo-make already installed" - - name: Install cargo-all-features - run: | - cargo install cargo-all-features || echo "cargo-all-features already installed" - name: run test uses: actions-rs/cargo@v1 env: diff --git a/Cargo.lock b/Cargo.lock index 088adf45d..f87fc142f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1172,6 +1172,7 @@ dependencies = [ "ff", "ff_ext", "generic-array", + "gkr", "goldilocks", "halo2curves 0.3.3", "itertools 0.12.1", @@ -1185,6 +1186,7 @@ dependencies = [ "rayon", "serde", "sha3", + "simple-frontend", "transcript", ] diff --git a/Makefile.toml b/Makefile.toml index 303bc7955..405844b1c 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -3,7 +3,6 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true CORE = { script = ["grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}'"] } RAYON_NUM_THREADS = "${CORE}" CUR_TARGET = { script = [ - # Command to check if the variable is not set, then assign output of the bash command ''' if [ -z "${TARGET}" ]; then TARGET=$(rustc -vV | grep "host" | awk '{print $2}') @@ -13,10 +12,23 @@ CUR_TARGET = { script = [ fi ''' ]} +TASK_RUN = { script = [ + ''' + #!/bin/bash + exclude_projects=" singer-pro ceno_rt " # NOTE:keep leading and end with one space + + if echo "$exclude_projects" | grep -q -E "( )${CARGO_MAKE_CRATE_NAME}( )"; then + echo "false" + else + echo "true" + fi + ''' +]} [tasks.tests] +condition = { env_true = ["TASK_RUN"] } command = "cargo" -args = ["test-all-features", "--lib", "--release", "--target", "${CUR_TARGET}", "--workspace", "--exclude", "singer-pro", "--exclude", "ceno_rt"] +args = ["test", "--lib", "--release", "--target", "${CUR_TARGET}", "-p", "${CARGO_MAKE_CRATE_NAME}"] [tasks.fmt-all-check] command = "cargo" diff --git a/ceno_zkvm/Cargo.toml b/ceno_zkvm/Cargo.toml index d97a3fc54..ce7c9bf59 100644 --- a/ceno_zkvm/Cargo.toml +++ b/ceno_zkvm/Cargo.toml @@ -42,13 +42,6 @@ const_env = "0.1.2" serde_json = "1.0.108" base64 = "0.22.1" - -[package.metadata.cargo-all-features] -skip_feature_sets = [ - ["riv64"], -] - - [build-dependencies] glob = "0.3" diff --git a/mpcs/Cargo.toml b/mpcs/Cargo.toml index ddc880ca9..0b6b0661c 100644 --- a/mpcs/Cargo.toml +++ b/mpcs/Cargo.toml @@ -34,6 +34,8 @@ transcript = { path = "../transcript" } plonky2 = "0.2.0" [dev-dependencies] +simple-frontend = { path = "../simple-frontend" } +gkr = { path = "../gkr" } criterion = { version = "0.5", features = ["html_reports"] } [features]