From cf62f5041d1da1c746b711b8a043dcf41d034294 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Mon, 9 Dec 2024 18:36:45 +0800 Subject: [PATCH 1/6] Check: integration tests are busted? --- .github/workflows/integration.yml | 4 ++-- Cargo.toml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 767758a8b..50bd7e2a2 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,10 +56,10 @@ jobs: - name: Run example env: RAYON_NUM_THREADS: 2 - run: cargo run --release --package ceno_zkvm --example riscv_opcodes --target ${{ matrix.target }} -- --start 10 --end 11 + run: cargo run --package ceno_zkvm --example riscv_opcodes --target ${{ matrix.target }} -- --start 10 --end 11 - name: Run fibonacci env: RAYON_NUM_THREADS: 8 RUST_LOG: debug - run: cargo run --release --package ceno_zkvm --bin e2e --target ${{ matrix.target }} -- --platform=sp1 ceno_zkvm/examples/fibonacci.elf \ No newline at end of file + run: cargo run --package ceno_zkvm --bin e2e --target ${{ matrix.target }} -- --platform=sp1 ceno_zkvm/examples/fibonacci.elf diff --git a/Cargo.toml b/Cargo.toml index 1ee0b66ef..4bc5f2458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,3 +54,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } [profile.release] lto = "thin" + +[profile.dev] +lto = "thin" +opt-level = 2 From 41b6c628924a964983a0f7bcc18eeb92dcca2d98 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Mon, 9 Dec 2024 19:14:48 +0800 Subject: [PATCH 2/6] Refine opt levels --- .github/workflows/integration.yml | 2 ++ Cargo.toml | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 50bd7e2a2..6643f85fa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,10 +56,12 @@ jobs: - name: Run example env: RAYON_NUM_THREADS: 2 + RUSTFLAGS: "-C opt-level=3 -C lto=thin" run: cargo run --package ceno_zkvm --example riscv_opcodes --target ${{ matrix.target }} -- --start 10 --end 11 - name: Run fibonacci env: RAYON_NUM_THREADS: 8 RUST_LOG: debug + RUSTFLAGS: "-C opt-level=3 -C lto=thin" run: cargo run --package ceno_zkvm --bin e2e --target ${{ matrix.target }} -- --platform=sp1 ceno_zkvm/examples/fibonacci.elf diff --git a/Cargo.toml b/Cargo.toml index 4bc5f2458..1ee0b66ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,3 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } [profile.release] lto = "thin" - -[profile.dev] -lto = "thin" -opt-level = 2 From bc58d3d880dce3d3826f636f31e684d65705b53d Mon Sep 17 00:00:00 2001 From: noelwei Date: Tue, 10 Dec 2024 12:05:42 +0900 Subject: [PATCH 3/6] fix #715 --- transcript/src/basic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transcript/src/basic.rs b/transcript/src/basic.rs index ec455d236..a9710d56c 100644 --- a/transcript/src/basic.rs +++ b/transcript/src/basic.rs @@ -32,7 +32,7 @@ impl Transcript for BasicTranscript { } fn read_challenge(&mut self) -> Challenge { - let r = E::from_bases(self.permutation.squeeze()); + let r = E::from_bases(&self.permutation.squeeze()[..2]); Challenge { elements: r } } From a211aad4a5d13fc1ae90da8145b87799491fbea0 Mon Sep 17 00:00:00 2001 From: noelwei Date: Tue, 10 Dec 2024 12:21:01 +0900 Subject: [PATCH 4/6] some comments --- transcript/src/basic.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transcript/src/basic.rs b/transcript/src/basic.rs index a9710d56c..c5d481116 100644 --- a/transcript/src/basic.rs +++ b/transcript/src/basic.rs @@ -32,6 +32,12 @@ impl Transcript for BasicTranscript { } fn read_challenge(&mut self) -> Challenge { + // notice `from_bases` and `from_limbs` has the same behavior but + // `from_bases` has a sanity check for length of input slices + // while `from_limbs` use the first two fields silently + // we select `from_base` here to make it being more clear that + // we only use the first 2 fields here to construct the + // extension field (i.e. the challenge) let r = E::from_bases(&self.permutation.squeeze()[..2]); Challenge { elements: r } From 794798d4be552780c72b6f4902d7d163a8a81539 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Tue, 10 Dec 2024 11:46:21 +0800 Subject: [PATCH 5/6] Fix formatting --- transcript/src/basic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transcript/src/basic.rs b/transcript/src/basic.rs index c5d481116..47c32cdf4 100644 --- a/transcript/src/basic.rs +++ b/transcript/src/basic.rs @@ -32,11 +32,11 @@ impl Transcript for BasicTranscript { } fn read_challenge(&mut self) -> Challenge { - // notice `from_bases` and `from_limbs` has the same behavior but + // notice `from_bases` and `from_limbs` has the same behavior but // `from_bases` has a sanity check for length of input slices // while `from_limbs` use the first two fields silently // we select `from_base` here to make it being more clear that - // we only use the first 2 fields here to construct the + // we only use the first 2 fields here to construct the // extension field (i.e. the challenge) let r = E::from_bases(&self.permutation.squeeze()[..2]); From 226d4c909b78dd462e7e8630c9009820b7c2ba73 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Tue, 10 Dec 2024 13:32:48 +0800 Subject: [PATCH 6/6] Fix --- .github/workflows/integration.yml | 4 ++-- Cargo.toml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 6643f85fa..ec0de0b14 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,12 +56,12 @@ jobs: - name: Run example env: RAYON_NUM_THREADS: 2 - RUSTFLAGS: "-C opt-level=3 -C lto=thin" + RUSTFLAGS: "-C opt-level=3" run: cargo run --package ceno_zkvm --example riscv_opcodes --target ${{ matrix.target }} -- --start 10 --end 11 - name: Run fibonacci env: RAYON_NUM_THREADS: 8 RUST_LOG: debug - RUSTFLAGS: "-C opt-level=3 -C lto=thin" + RUSTFLAGS: "-C opt-level=3" run: cargo run --package ceno_zkvm --bin e2e --target ${{ matrix.target }} -- --platform=sp1 ceno_zkvm/examples/fibonacci.elf diff --git a/Cargo.toml b/Cargo.toml index 1ee0b66ef..ead19b880 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,5 +52,8 @@ tracing = { version = "0.1", features = [ tracing-forest = { version = "0.1.6" } tracing-subscriber = { version = "0.3", features = ["env-filter"] } +[profile.dev] +lto = "thin" + [profile.release] lto = "thin"