Skip to content

Commit

Permalink
minor fix change Arc<Vec<...>> -> &[...]
Browse files Browse the repository at this point in the history
  • Loading branch information
xavi-pinsach committed Dec 16, 2024
1 parent d65c344 commit e160cbb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<F: PrimeField> ZiskExecutor<F> {
// ---------------------------------------------------------------------------------
sec_instances.par_iter_mut().for_each(|(global_idx, sec_instance)| {
if sec_instance.instance_type() == InstanceType::Instance {
let _ = sec_instance.collect_inputs(&self.zisk_rom, min_traces.clone());
let _ = sec_instance.collect_inputs(&self.zisk_rom, &min_traces);
if let Some(air_instance) = sec_instance.compute_witness() {
let pctx = self.wcm.get_pctx();
pctx.air_instance_repo.add_air_instance(air_instance, Some(*global_idx));
Expand Down
2 changes: 1 addition & 1 deletion state-machines/arith/src/arith_full_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<F: PrimeField> Instance<F> for ArithFullInstance<F> {
fn collect_inputs(
&mut self,
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
min_traces: &[EmuTrace],
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion state-machines/binary/src/binary_basic_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<F: PrimeField> Instance<F> for BinaryBasicInstance<F> {
fn collect_inputs(
&mut self,
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
min_traces: &[EmuTrace],
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion state-machines/binary/src/binary_extension_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<F: PrimeField> Instance<F> for BinaryExtensionInstance<F> {
fn collect_inputs(
&mut self,
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
min_traces: &[EmuTrace],
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
Expand Down
4 changes: 1 addition & 3 deletions state-machines/common/src/component_instance.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use p3_field::PrimeField;
use proofman_common::AirInstance;
use zisk_core::ZiskRom;
Expand All @@ -15,7 +13,7 @@ pub trait Instance<F: PrimeField>: Send + Sync {
fn collect_inputs(
&mut self,
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
min_traces: &[EmuTrace],
) -> Result<(), Box<dyn std::error::Error + Send>> {
let _ = zisk_rom;
let _ = min_traces;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use crate::CheckPoint;
use zisk_common::InstObserver;
use zisk_core::{InstContext, ZiskInst, ZiskOperationType, ZiskRequiredOperation};
Expand All @@ -22,7 +20,7 @@ impl InputsCollector {
check_point: CheckPoint,
num_rows: usize,
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
min_traces: &[EmuTrace],
op_type: ZiskOperationType,
) -> Result<Vec<ZiskRequiredOperation>, Box<dyn std::error::Error + Send>> {
let mut instance =
Expand All @@ -32,7 +30,7 @@ impl InputsCollector {

let observer: &mut dyn InstObserver = &mut instance;

ZiskEmulator::process_rom_slice_plan(zisk_rom, &min_traces, chunk_id, observer);
ZiskEmulator::process_rom_slice_plan(zisk_rom, min_traces, chunk_id, observer);

Ok(std::mem::take(&mut instance.inputs))
}
Expand Down

0 comments on commit e160cbb

Please sign in to comment.