Skip to content

Commit

Permalink
bugfix in identifying a chunk's accessed memory (#2316)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacheco authored Jan 9, 2025
1 parent 725fceb commit e4d9fcb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion riscv/src/continuations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,16 @@ pub fn rust_continuations_dry_run<F: FieldElement>(
let mut accessed_pages = BTreeSet::new();
let mut accessed_addresses = BTreeSet::new();

let start_idx = full_exec
let mut start_idx = full_exec
.memory_accesses
.binary_search_by_key(&proven_trace, |a| a.row)
.unwrap_or_else(|v| v);
// We may have multiple memory accesses in the same row and binary
// search may return any match in case of multiple: ensure idx points to
// first match
while start_idx > 0 && full_exec.memory_accesses[start_idx - 1].row == proven_trace {
start_idx -= 1;
}

for access in &full_exec.memory_accesses[start_idx..] {
// proven_trace + length is an upper bound for the last row index we'll reach in the next chunk.
Expand Down

0 comments on commit e4d9fcb

Please sign in to comment.