Sumcheck Verification Failure for Guest with `rem` Instruction
When executing the provided guest program with an inline assembly `rem` instruction, jolt panics with `Verification failed: Stage 5`.
**Error**
```bash
$> cargo run --release
thread 'main' panicked at /root/jolt/jolt-core/src/zkvm/mod.rs:409:40:
Verification failed: Stage 5
Caused by:
Sumcheck verification failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
**lib.rs**
```rust
#![cfg_attr(feature = "guest", no_std)]
#[jolt::provable(guest_only, memory_size = 10240, max_trace_length = 65536)]
fn test(x: u32, y: u32) -> u32 {
let result: u32;
unsafe {
core::arch::asm!(
"rem {result}, {a}, {b}",
result = out(reg) result,
a = in(reg) x, // 0_u32,
b = in(reg) y, // 4294967295_u32,
);
}
result
}
```
**main.rs**
```rust
pub fn main() {
let x = 0_u32;
let y = 4294967295_u32;
let target_dir = "/tmp/jolt-guest-targets";
let mut program = guest::compile_test(target_dir);
let prover_preprocessing = guest::preprocess_prover_test(&mut program);
let verifier_preprocessing = guest::verifier_preprocessing_from_prover_test(&prover_preprocessing);
let prove_test = guest::build_prover_test(program, prover_preprocessing);
let verify_test = guest::build_verifier_test(verifier_preprocessing);
let (output, proof, program_io) = prove_test(x, y);
if !verify_test(x, y, output, program_io.panic, proof) {
panic!("verifier failed!");
}
}
```
* commit: 34a9dda9cebdfa7f4d1a4236811b06bfc1a1ee08
关闭于 2025-11-13 1 条评论