From e3169efcb4172e2a3dbb7f1b08268c3f2342a80c Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Mon, 8 Jun 2026 16:43:15 +0800 Subject: [PATCH] fix(ram): keep dynamic init witness padding zero --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 20 ++++++++++---------- ceno_zkvm/src/tables/ram/ram_impl.rs | 4 +++- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0945d22db..e264985db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2237,7 +2237,7 @@ dependencies = [ [[package]] name = "ff_ext" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "once_cell", "p3", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "mpcs" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "bincode 1.3.3", "clap", @@ -3266,7 +3266,7 @@ dependencies = [ [[package]] name = "multilinear_extensions" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "either", "ff_ext", @@ -4557,7 +4557,7 @@ dependencies = [ [[package]] name = "p3" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "p3-air", "p3-baby-bear", @@ -5125,7 +5125,7 @@ dependencies = [ [[package]] name = "poseidon" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "ff_ext", "p3", @@ -6082,7 +6082,7 @@ dependencies = [ [[package]] name = "sp1-curves" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "cfg-if", "dashu", @@ -6207,7 +6207,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sumcheck" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "either", "ff_ext", @@ -6225,7 +6225,7 @@ dependencies = [ [[package]] name = "sumcheck_macro" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "itertools 0.13.0", "p3", @@ -6632,7 +6632,7 @@ dependencies = [ [[package]] name = "transcript" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "ff_ext", "itertools 0.13.0", @@ -6926,7 +6926,7 @@ dependencies = [ [[package]] name = "whir" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "bincode 1.3.3", "clap", @@ -7213,7 +7213,7 @@ dependencies = [ [[package]] name = "witness" version = "0.1.0" -source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.31#8b847f489031a82ed0dfd0041ea93c5e09be590e" +source = "git+https://github.com/scroll-tech/gkr-backend.git?tag=v1.0.0-alpha.32#83cf5bb5e90a2134fc4f2778a025f1f127befbd1" dependencies = [ "ff_ext", "multilinear_extensions", diff --git a/Cargo.toml b/Cargo.toml index b059df69e..3aefff457 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,16 +27,16 @@ version = "0.1.0" ceno_crypto_primitives = { git = "https://github.com/scroll-tech/ceno-patch.git", package = "ceno_crypto_primitives", branch = "main" } ceno_syscall = { git = "https://github.com/scroll-tech/ceno-patch.git", package = "ceno_syscall", branch = "main" } -ff_ext = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "ff_ext", tag = "v1.0.0-alpha.31" } -mpcs = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "mpcs", tag = "v1.0.0-alpha.31" } -multilinear_extensions = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "multilinear_extensions", tag = "v1.0.0-alpha.31" } -p3 = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "p3", tag = "v1.0.0-alpha.31" } -poseidon = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "poseidon", tag = "v1.0.0-alpha.31" } -sp1-curves = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sp1-curves", tag = "v1.0.0-alpha.31" } -sumcheck = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sumcheck", tag = "v1.0.0-alpha.31" } -transcript = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "transcript", tag = "v1.0.0-alpha.31" } -whir = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "whir", tag = "v1.0.0-alpha.31" } -witness = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "witness", tag = "v1.0.0-alpha.31" } +ff_ext = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "ff_ext", tag = "v1.0.0-alpha.32" } +mpcs = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "mpcs", tag = "v1.0.0-alpha.32" } +multilinear_extensions = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "multilinear_extensions", tag = "v1.0.0-alpha.32" } +p3 = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "p3", tag = "v1.0.0-alpha.32" } +poseidon = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "poseidon", tag = "v1.0.0-alpha.32" } +sp1-curves = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sp1-curves", tag = "v1.0.0-alpha.32" } +sumcheck = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sumcheck", tag = "v1.0.0-alpha.32" } +transcript = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "transcript", tag = "v1.0.0-alpha.32" } +whir = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "whir", tag = "v1.0.0-alpha.32" } +witness = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "witness", tag = "v1.0.0-alpha.32" } anyhow = { version = "1.0", default-features = false } bincode = "1" diff --git a/ceno_zkvm/src/tables/ram/ram_impl.rs b/ceno_zkvm/src/tables/ram/ram_impl.rs index 009fefefc..39591d764 100644 --- a/ceno_zkvm/src/tables/ram/ram_impl.rs +++ b/ceno_zkvm/src/tables/ram/ram_impl.rs @@ -324,7 +324,9 @@ impl DynVolatileRamTableInitCo rec.addr, expected_addr, ); } - if let Some(rec) = rec_opt { + if i < *num_instances + && let Some(rec) = rec_opt + { if init_v.len() == 1 { // Assign value directly. set_val!(row, init_v[0], rec.init_value as u64);