Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aaccc3a
ceno + babybear
hero78119 Mar 24, 2025
a7ede32
refactor challenger usage
hero78119 Mar 25, 2025
aef744c
make clippy happy
hero78119 Mar 25, 2025
e0cdd2b
remove randomness of babybear permutation
hero78119 Mar 25, 2025
b6f5920
code cleanup
hero78119 Mar 25, 2025
721e167
merge with master
hero78119 Mar 25, 2025
58e92aa
add preproof flow in e2e
hero78119 Mar 25, 2025
d39319c
merge with master
hero78119 Apr 17, 2025
8b69171
merge with master
hero78119 Apr 21, 2025
cf53b27
Merge branch 'master' into feat/smaller_field_support
darth-cy Jun 25, 2025
3bdfbb3
Fine tune merge issues
darth-cy Jun 25, 2025
f25397b
Correct two adicity for babybear run case
darth-cy Jun 29, 2025
70a4f50
Field access adjustment
darth-cy Jun 29, 2025
79e17e0
Merge remote-tracking branch 'origin/master' into feat/smaller_field_…
kunxian-xia Jul 15, 2025
2d134ed
more field access adjustments
kunxian-xia Jul 21, 2025
f3c5db6
Update Plonky3
darth-cy Jul 22, 2025
df4a611
Change revision hash
darth-cy Jul 22, 2025
18db3e2
Merge branch 'master' into feat/smaller_field_support
darth-cy Jul 23, 2025
05c1031
Disable subcircuits
darth-cy Jul 23, 2025
dfc95eb
Merge branch 'feat/smaller_field_support' into build/smaller_field_su…
darth-cy Jul 23, 2025
4321011
fix few places to support < u32 prime field
hero78119 Jul 23, 2025
a184db1
make basefold related structs public
kunxian-xia Jul 23, 2025
c1f92e9
Merge remote-tracking branch 'origin/feat/smaller_field_support' into…
kunxian-xia Jul 23, 2025
55ae036
make basefold::structure module public
kunxian-xia Jul 23, 2025
1acd5ed
Merge remote-tracking branch 'origin/feat/smaller_field_support' into…
kunxian-xia Jul 23, 2025
e7a16d5
Merge branch 'master' into build/smaller_field_support_verify
darth-cy Jul 29, 2025
20fa213
Verify proof
darth-cy Jul 29, 2025
6b24e30
merge with master
hero78119 Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Cargo.lock

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

30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ num-bigint = { version = "0.4.6" }
num-derive = "0.4"
num-traits = "0.2"
p3 = { path = "p3" }
p3-baby-bear = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-challenger = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-commit = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-dft = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-field = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-fri = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-goldilocks = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-matrix = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-maybe-rayon = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-mds = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-merkle-tree = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-poseidon = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-poseidon2 = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-symmetric = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-util = { git = "https://github.com/Plonky3/plonky3", rev = "1ba4e5c" }
p3-baby-bear = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-challenger = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-commit = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-dft = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-field = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-fri = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-goldilocks = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-matrix = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-maybe-rayon = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-mds = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-merkle-tree = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-poseidon = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-poseidon2 = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-symmetric = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
p3-util = { git = "https://github.com/Plonky3/plonky3", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" }
paste = "1"
poseidon = { path = "./poseidon" }
pprof2 = { version = "0.13", features = ["flamegraph"] }
Expand Down
9 changes: 3 additions & 6 deletions ceno_zkvm/src/bin/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,10 @@ fn run_inner<
let proof_bytes = bincode::serialize(&zkvm_proof).unwrap();
fs::write(&proof_file, proof_bytes).unwrap();
let vk_bytes = bincode::serialize(&vk).unwrap();
fs::write(&vk_file, vk_bytes).unwrap();
std::fs::write(&vk_file, vk_bytes).unwrap();

if checkpoint > Checkpoint::PrepVerify {
let verifier = ZKVMVerifier::new(vk);
verify(&zkvm_proof, &verifier).expect("Verification failed");
soundness_test(zkvm_proof, &verifier);
}
let verifier = ZKVMVerifier::new(vk);
verify(&zkvm_proof, &verifier).expect("Verification failed");
}

fn soundness_test<E: ExtensionField, Pcs: PolynomialCommitmentScheme<E>>(
Expand Down
15 changes: 13 additions & 2 deletions ceno_zkvm/src/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ use ceno_emul::{
StepRecord, Tracer, VMState, WORD_SIZE, WordAddr, host_utils::read_all_messages,
};
use clap::ValueEnum;
use ff_ext::ExtensionField;
use ff_ext::{BabyBearExt4, ExtensionField};
#[cfg(debug_assertions)]
use ff_ext::{Instrumented, PoseidonField};
use gkr_iop::hal::ProverBackend;
use itertools::{Itertools, MinMaxResult, chain};
use mpcs::{PolynomialCommitmentScheme, SecurityLevel};
use mpcs::{Basefold, BasefoldRSParams, PolynomialCommitmentScheme, SecurityLevel};
use p3::{babybear::BabyBear, goldilocks::Goldilocks};
use serde::Serialize;
use std::{
collections::{BTreeSet, HashMap, HashSet},
sync::Arc,
};
use tracing::info;
use transcript::BasicTranscript as Transcript;

/// The polynomial commitment scheme kind
Expand Down Expand Up @@ -75,6 +77,14 @@ pub enum FieldType {
BabyBear,
}

// pub type E = GoldilocksExt2;
// pub type B = Goldilocks;
// pub type Pcs = Basefold<GoldilocksExt2, BasefoldRSParams>;

pub type E = BabyBearExt4;
pub type B = BabyBear;
pub type Pcs = Basefold<E, BasefoldRSParams>;

pub struct FullMemState<Record> {
pub mem: Vec<Record>,
pub io: Vec<Record>,
Expand Down Expand Up @@ -507,6 +517,7 @@ pub fn generate_witness<E: ExtensionField>(
pub enum Checkpoint {
PrepE2EProving,
PrepWitnessGen,
PrepProof,
PrepVerify,
#[default]
Complete,
Expand Down
4 changes: 2 additions & 2 deletions ceno_zkvm/src/instructions/riscv/branch/branch_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ impl<E: ExtensionField, I: RIVInstruction> Instruction<E> for BranchCircuit<E, I
if let Some(equal) = &config.is_equal {
equal.assign_instance(
instance,
E::BaseField::from_canonical_u64(rs2.as_u64()),
E::BaseField::from_canonical_u64(rs1.as_u64()),
E::BaseField::from_wrapped_u64(rs2.as_u64()),
E::BaseField::from_wrapped_u64(rs1.as_u64()),
)?;
}

Expand Down
7 changes: 4 additions & 3 deletions ceno_zkvm/src/instructions/riscv/jump/jalr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::marker::PhantomData;

use either::Either;
use ff_ext::ExtensionField;
use std::marker::PhantomData;

use crate::{
Value,
Expand Down Expand Up @@ -81,10 +81,11 @@ impl<E: ExtensionField> Instruction<E> for JalrInstruction<E> {
(overflow.expr(), Some((overflow, tmp)))
};

let pow2_32 = E::BaseField::from_wrapped_u64(1u64 << 32).expr();
circuit_builder.require_equal(
|| "rs1+imm = next_pc_unrounded + overflow*2^32",
rs1_read.value() + imm.expr(),
next_pc_addr.expr_unaligned() + overflow_expr * (1u64 << 32),
next_pc_addr.expr_unaligned() + overflow_expr * pow2_32,
)?;

circuit_builder.require_equal(
Expand Down
Loading
Loading