Skip to content

Support for sproll-evm proving (WIP) #809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
16 changes: 5 additions & 11 deletions ceno_emul/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@ pub struct Platform {

impl Display for Platform {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let prog_data: Option<Range<Addr>> = match (self.prog_data.first(), self.prog_data.last()) {
(Some(first), Some(last)) => Some(*first..*last),
_ => None,
let prog_data = match (self.prog_data.first(), self.prog_data.last()) {
(Some(first), Some(last)) => format!("{:#x?}", *first..*last),
_ => "-".to_string(),
};
write!(
f,
"Platform {{ rom: {:?}, prog_data: {:?}, stack: {:?}, heap: {:?}, public_io: {:?}, hints: {:?}, unsafe_ecall_nop: {} }}",
self.rom,
prog_data,
self.stack,
self.heap,
self.public_io,
self.hints,
self.unsafe_ecall_nop
"Platform {{ rom: {:#x?}, prog_data: {prog_data}, stack: {:#x?}, heap: {:x?}, public_io: {:#x?}, hints: {:#x?}, unsafe_ecall_nop: {} }}",
self.rom, self.stack, self.heap, self.public_io, self.hints, self.unsafe_ecall_nop
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ceno_zkvm/src/bin/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn main() {
);
tracing::info!("Running on platform {:?} {}", args.platform, platform);
tracing::info!(
"Stack: {} bytes. Heap: {} bytes.",
"Stack: {:#x?} bytes. Heap: {:#x?} bytes.",
args.stack_size,
args.heap_size
);
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 @@ -45,6 +45,7 @@ pub struct EmulationResult {
pi: PublicValues<u32>,
}

// TODO(Matthias): handle hints properly.
fn emulate_program(
program: Arc<Program>,
max_steps: usize,
Expand Down Expand Up @@ -574,8 +575,18 @@ fn debug_memory_ranges(vm: &VMState, mem_final: &[MemFinalRecord]) {
format_segments(vm.platform(), handled_addrs.iter().copied())
);

for addr in &accessed_addrs {
assert!(handled_addrs.contains(addr), "unhandled addr: {:?}", addr);
let unhandled: BTreeSet<_> = accessed_addrs
.iter()
.filter(|addr| !handled_addrs.contains(addr))
.collect();

// TODO(Matthias): this should be an assert, but it's currently broken, because our caller doesn't handle hints.
if !unhandled.is_empty() {
tracing::warn!(
"unhandled addr: {:?} to {:?}",
unhandled.first(),
unhandled.last()
);
}
}

Expand Down
3 changes: 2 additions & 1 deletion ceno_zkvm/src/scheme/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pub(crate) const SEL_DEGREE: usize = 2;
pub const NUM_FANIN: usize = 2;
pub const NUM_FANIN_LOGUP: usize = 2;

pub const MAX_NUM_VARIABLES: usize = 24;
// TODO(Matthias): what are the trade-offs for this value?
pub const MAX_NUM_VARIABLES: usize = 27;