Skip to content

Commit

Permalink
change InstanceObserver name to InputsCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
xavi-pinsach committed Dec 12, 2024
1 parent c985df4 commit fc74053
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions state-machines/arith/src/arith_full_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use p3_field::PrimeField;

use proofman_common::{AirInstance, FromTrace};
use sm_common::{Instance, InstanceExpanderCtx, InstanceType, RegularInstance};
use sm_common::{InputsCollector, Instance, InstanceExpanderCtx, InstanceType};
use zisk_core::{ZiskRequiredOperation, ZiskRom};
use zisk_pil::ArithTrace;
use ziskemu::EmuTrace;
Expand All @@ -29,7 +29,7 @@ impl<F: PrimeField> Instance<F> for ArithFullInstance<F> {
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = RegularInstance::collect(
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
ArithTrace::<F>::NUM_ROWS,
zisk_rom,
Expand Down
4 changes: 2 additions & 2 deletions state-machines/binary/src/binary_basic_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use p3_field::PrimeField;

use proofman_common::{AirInstance, FromTrace};
use sm_common::{Instance, InstanceExpanderCtx, InstanceType, RegularInstance};
use sm_common::{InputsCollector, Instance, InstanceExpanderCtx, InstanceType};
use zisk_core::{ZiskRequiredOperation, ZiskRom};
use zisk_pil::BinaryTrace;
use ziskemu::EmuTrace;
Expand All @@ -30,7 +30,7 @@ impl<F: PrimeField> Instance<F> for BinaryBasicInstance<F> {
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = RegularInstance::collect(
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
BinaryTrace::<F>::NUM_ROWS,
zisk_rom,
Expand Down
4 changes: 2 additions & 2 deletions state-machines/binary/src/binary_extension_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use p3_field::PrimeField;

use proofman_common::{AirInstance, FromTrace};
use proofman_util::{timer_start_debug, timer_stop_and_log_debug};
use sm_common::{Instance, InstanceExpanderCtx, InstanceType, RegularInstance};
use sm_common::{InputsCollector, Instance, InstanceExpanderCtx, InstanceType};
use zisk_core::{ZiskRequiredOperation, ZiskRom};
use zisk_pil::BinaryExtensionTrace;
use ziskemu::EmuTrace;
Expand Down Expand Up @@ -36,7 +36,7 @@ impl<F: PrimeField> Instance<F> for BinaryExtensionInstance<F> {
zisk_rom: &ZiskRom,
min_traces: Arc<Vec<EmuTrace>>,
) -> Result<(), Box<dyn std::error::Error + Send>> {
self.inputs = RegularInstance::collect(
self.inputs = InputsCollector::collect(
self.iectx.plan.check_point.unwrap(),
BinaryExtensionTrace::<F>::NUM_ROWS,
zisk_rom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use zisk_core::{InstContext, ZiskInst, ZiskOperationType, ZiskRequiredOperation}
use zisk_core::ZiskRom;
use ziskemu::{EmuTrace, ZiskEmulator};

pub struct RegularInstance {
pub struct InputsCollector {
check_point: CheckPoint,
num_rows: usize,
op_type: ZiskOperationType,
Expand All @@ -17,7 +17,7 @@ pub struct RegularInstance {
inputs: Vec<ZiskRequiredOperation>,
}

impl RegularInstance {
impl InputsCollector {
pub fn collect(
check_point: CheckPoint,
num_rows: usize,
Expand All @@ -38,7 +38,7 @@ impl RegularInstance {
}
}

impl InstObserver for RegularInstance {
impl InstObserver for InputsCollector {
#[inline(always)]
fn on_instruction(&mut self, zisk_inst: &ZiskInst, inst_ctx: &InstContext) -> bool {
if zisk_inst.op_type != self.op_type {
Expand Down
4 changes: 2 additions & 2 deletions state-machines/common/src/instance_observer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mod regular_instance_observer;
mod inputs_collector;

pub use regular_instance_observer::*;
pub use inputs_collector::*;

0 comments on commit fc74053

Please sign in to comment.