Skip to content

Commit

Permalink
o1vm/witnessenv/lookup: add an arity tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbeunardeau88 committed Feb 4, 2025
1 parent c63b1cb commit 4a6b7a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions o1vm/src/interpreters/mips/tests_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ where
lookup_multiplicities: LookupMultiplicities::new(),
lookup_state_idx: 0,
lookup_state: vec![],
lookup_arity: vec![],
selector: crate::interpreters::mips::column::N_MIPS_SEL_COLS,
halt: false,
// Keccak related
Expand Down
5 changes: 5 additions & 0 deletions o1vm/src/interpreters/mips/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ pub struct Env<Fp, PreImageOracle: PreImageOracleT> {
pub scratch_state_inverse: [Fp; SCRATCH_SIZE_INVERSE],
pub lookup_state_idx: usize,
pub lookup_state: Vec<Fp>,
// tracks the arity of every lookup
// [1,1,3] means that the lookup state is of size 5,
// containing two lookup of arity one and one of arity three.
pub lookup_arity: Vec<usize>,
pub halt: bool,
pub syscall_env: SyscallEnv,
pub selector: usize,
Expand Down Expand Up @@ -963,6 +967,7 @@ impl<Fp: PrimeField, PreImageOracle: PreImageOracleT> Env<Fp, PreImageOracle> {
scratch_state_inverse: fresh_scratch_state(),
lookup_state_idx: 0,
lookup_state: vec![],
lookup_arity: vec![],
halt: state.exited,
syscall_env,
selector,
Expand Down

0 comments on commit 4a6b7a6

Please sign in to comment.