0xMiden / 0xMiden/miden-vm

Non-empty stack overflow table

Đang mở
#1,537 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
instruction set
Ngôn ngữ chính
Rust
Star
772
Fork
352
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
93

Mô tả

The following test fails with error `OutputStackOverflow(1)`, presumably because there were 2 `PUSH` instructions, and one `ADD` (which shifts stack left), and so the overflow table contains a 0 entry at the end and is contained non-empty. This is probably a new behavior since #1456.

I'm not sure why this doesn't occur in more tests yet, but it seems like the behavior we want is: if a 0 is pushed onto the stack overflow table, and the table is empty, then don't populate the overflow table (since when we shift right on an empty overflow table, we populate `s[15]` with 0).

```rs
#[test]
fn test() {
use crate::{prove, Assembler, DefaultHost, Program, ProvingOptions, StackInputs};
// instantiate the assembler
let mut assembler = Assembler::default();

// this is our program, we compile it from assembly code
let program = assembler.assemble_program("begin push.3 push.5 add end").unwrap();

// let's execute it and generate a STARK proof
let (outputs, proof) = prove(
&program,
StackInputs::default(), // we won't provide any inputs
DefaultHost::default(), // we'll be using a default host
ProvingOptions::default(), // we'll be using default options
)
.unwrap();

// the output should be 8
assert_eq!(8, outputs.first().unwrap().as_int());
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.