Skip to content

Commit

Permalink
modify previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Velaciela committed Oct 8, 2023
1 parent 7bedb67 commit 4c12249
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions halo2_proofs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,21 +710,6 @@ impl<'a, F: Field + Group> Assignment<F> for MockProver<'a, F> {
return Err(Error::not_enough_rows_available(self.k));
}

if self.in_phase(FirstPhase) {
if !self.usable_rows.contains(&row) {
return Err(Error::not_enough_rows_available(self.k));
}

if let Some(region) = self.current_region.as_mut() {
region.update_extent(column.into(), row);
region
.cells
.entry((column.into(), row))
.and_modify(|count| *count += 1)
.or_default();
}
}

if !self.rw_rows.contains(&row) {
return Err(Error::InvalidRange(
row,
Expand Down Expand Up @@ -763,13 +748,11 @@ impl<'a, F: Field + Group> Assignment<F> for MockProver<'a, F> {
#[cfg(feature = "mock-batch-inv")]
let assigned = CellValue::from(val_res?);

if self.in_phase(column.column_type().phase) {
*self
.advice
.get_mut(column.index())
.and_then(|v| v.get_mut(row))
.ok_or(Error::BoundsFailure)? = assigned;
}
*self
.advice
.get_mut(column.index())
.and_then(|v| v.get_mut(row))
.ok_or(Error::BoundsFailure)? = assigned;

#[cfg(feature = "phase-check")]
// if false && self.current_phase.0 > column.column_type().phase.0 {
Expand Down Expand Up @@ -1083,7 +1066,15 @@ impl<'a, F: FieldExt> MockProver<'a, F> {
#[cfg(not(feature = "phase-check"))]
{
let syn_time = Instant::now();
ConcreteCircuit::FloorPlanner::synthesize(&mut prover, circuit, config, constants)?;
for current_phase in prover.cs.phases() {
prover.current_phase = current_phase;
ConcreteCircuit::FloorPlanner::synthesize(
&mut prover,
circuit,
config.clone(),
constants.clone(),
)?;
}
log::info!("MockProver synthesize took {:?}", syn_time.elapsed());
}

Expand Down

0 comments on commit 4c12249

Please sign in to comment.