Skip to content

Commit

Permalink
fix: few regression fixes (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevjue authored Mar 26, 2024
1 parent fde3e6c commit c2f5bfa
Show file tree
Hide file tree
Showing 30 changed files with 3,163 additions and 1,874 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion core/src/cpu/air/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl CpuChip {
// When we are branching, assert that local.pc <==> branch_columns.next_pc as Word.
builder
.when_transition()
.when(next.is_real)
.when(local.branching)
.assert_eq(branch_cols.next_pc.reduce::<AB>(), next.pc);

Expand All @@ -61,9 +62,9 @@ impl CpuChip {

// When we are not branching, assert that local.pc + 4 <==> next.pc.
builder
.when(local.not_branching)
.when_transition()
.when(next.is_real)
.when(local.not_branching)
.assert_eq(local.pc + AB::Expr::from_canonical_u8(4), next.pc);
}

Expand Down
1 change: 1 addition & 0 deletions core/src/cpu/air/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ impl CpuChip {
// Verify that the word form of next.pc is correct for both jump instructions.
builder
.when_transition()
.when(next.is_real)
.when(local.selectors.is_jal + local.selectors.is_jalr)
.assert_eq(jump_columns.next_pc.reduce::<AB>(), next.pc);

Expand Down
7 changes: 7 additions & 0 deletions core/src/stark/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ pub mod tests {
use crate::runtime::tests::fibonacci_program;
use crate::runtime::tests::simple_memory_program;
use crate::runtime::tests::simple_program;
use crate::runtime::tests::ssz_withdrawals_program;
use crate::runtime::Instruction;
use crate::runtime::Opcode;
use crate::runtime::Program;
Expand Down Expand Up @@ -458,4 +459,10 @@ pub mod tests {
let program = simple_memory_program();
run_test(program).unwrap();
}

#[test]
fn test_ssz_withdrawal() {
let program = ssz_withdrawals_program();
run_test(program).unwrap();
}
}
Binary file modified examples/chess/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Loading

0 comments on commit c2f5bfa

Please sign in to comment.