Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Architecture explanation] MV Lookup PR #16

Draft
wants to merge 28 commits into
base: scroll-before-mvlookup
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0acd958
Add mv_lookup.rs
akinovak Mar 22, 2023
459824f
mv_lookup::prover, mv_lookup::verifier
akinovak Mar 22, 2023
fb058a0
Replace lookup with mv_lookup
akinovak Mar 22, 2023
6d1bfd8
replace halo2 with mv lookup
akinovak Mar 22, 2023
b71441a
cleanups
akinovak Mar 22, 2023
022ce26
ConstraintSystem: setup lookup_tracker
therealyingtong Mar 31, 2023
d892ec2
mv_lookup::hybrid_prover
therealyingtong Apr 1, 2023
cde12f3
WIP
therealyingtong Apr 2, 2023
4b67967
mv_multi_lookup: enable lookup caching
akinovak Apr 2, 2023
6ed69e0
Rename hybrid_lookup -> lookup
therealyingtong Apr 3, 2023
384787a
Chunk lookups using user-provided minimum degree
therealyingtong Apr 3, 2023
f7e76be
mv_lookup bench
therealyingtong Apr 3, 2023
27abc7e
Introduce counter feature for FFTs and MSMs
therealyingtong Apr 3, 2023
855edb8
Fix off-by-one errors in chunk_lookup
therealyingtong Apr 3, 2023
9b44407
bench wip
therealyingtong Apr 3, 2023
19b7660
time evaluate_h
therealyingtong Apr 4, 2023
e92636d
KZG
therealyingtong Apr 4, 2023
a41fad8
more efficient batch inversion
therealyingtong Apr 4, 2023
163b8e4
extended lookup example
therealyingtong Apr 4, 2023
4b7d24b
Finalize mv lookup
akinovak Apr 12, 2023
992325b
Remove main/
spherel Jul 4, 2023
82f4d6d
Merge with latest develop branch
spherel Aug 11, 2023
8eaef4f
Fix according to the comments
spherel Oct 12, 2023
df7b557
replace scan with parallel grand sum computation
spherel Oct 12, 2023
24f182a
Revert Cargo.lock
spherel Oct 12, 2023
62a16d0
mv lookup Argument name
spherel Oct 12, 2023
6f1e678
parallel batch invert
spherel Oct 12, 2023
a265b2c
Merge branch 'develop-rc' into develop-mvlookup
spherel Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ harness = false
name = "dev_lookup"
harness = false

[[bench]]
name = "lookups"
harness = false

[[bench]]
name = "fft"
harness = false
Expand All @@ -63,12 +67,14 @@ crossbeam = "0.8.0"
# Developer tooling dependencies
plotters = { version = "0.3.0", optional = true }
tabbycat = { version = "0.1", features = ["attributes"], optional = true }
lazy_static = { version = "1", optional = true }
log = "0.4.17"

# timer
ark-std = { version = "0.3.0" }
env_logger = "0.8.0"


[dev-dependencies]
assert_matches = "1.5"
criterion = "0.3"
Expand All @@ -90,6 +96,7 @@ gwc = []
parallel_syn = []
phase-check = []
profile = ["ark-std/print-trace"]
counter = ["lazy_static"]
mock-batch-inv = []

[lib]
Expand Down
239 changes: 239 additions & 0 deletions halo2_proofs/benches/lookups.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
#[macro_use]
extern crate criterion;

use halo2_proofs::arithmetic::FieldExt;
use halo2_proofs::circuit::{Layouter, SimpleFloorPlanner, Value};
use halo2_proofs::plonk::*;
use halo2_proofs::poly::kzg::multiopen::VerifierGWC;
use halo2_proofs::poly::{commitment::ParamsProver, Rotation};
use halo2_proofs::transcript::{Blake2bRead, Blake2bWrite, Challenge255};
use halo2curves::bn256::{Bn256, G1Affine};
use halo2curves::pairing::Engine;
use rand_core::OsRng;

use halo2_proofs::{
poly::{
kzg::{
commitment::{KZGCommitmentScheme, ParamsKZG},
multiopen::ProverGWC,
strategy::SingleStrategy,
},
},
transcript::{TranscriptReadBuffer, TranscriptWriterBuffer},
};

use std::marker::PhantomData;

use criterion::{BenchmarkId, Criterion};

fn criterion_benchmark(c: &mut Criterion) {
#[derive(Clone, Default)]
struct MyCircuit<F: FieldExt> {
_marker: PhantomData<F>,
}

#[derive(Clone)]
struct MyConfig {
selector: Selector,
table: TableColumn,
advice: Column<Advice>,
other_advice: Column<Advice>,
}

impl<F: FieldExt> Circuit<F> for MyCircuit<F> {
type Config = MyConfig;
type FloorPlanner = SimpleFloorPlanner;

fn without_witnesses(&self) -> Self {
Self::default()
}

fn configure(meta: &mut ConstraintSystem<F>) -> MyConfig {
let config = MyConfig {
selector: meta.complex_selector(),
table: meta.lookup_table_column(),
advice: meta.advice_column(),
other_advice: meta.advice_column(),
};

let dummy_selector = meta.complex_selector();

meta.create_gate("degree 6 gate", |meta| {
let dummy_selector = meta.query_selector(dummy_selector);
let constraints = vec![dummy_selector.clone(); 4].iter().fold(dummy_selector.clone(), |acc, val| acc * val.clone());
Constraints::with_selector(dummy_selector, Some(constraints))
});

meta.lookup("lookup", |meta| {
let advice = meta.query_advice(config.advice, Rotation::cur());
vec![(advice, config.table)]
});

meta.lookup("lookup", |meta| {
let advice = meta.query_advice(config.advice, Rotation::cur());
vec![(advice, config.table)]
});

meta.lookup("lookup", |meta| {
let advice = meta.query_advice(config.advice, Rotation::cur());
vec![(advice, config.table)]
});

meta.lookup("lookup", |meta| {
let advice = meta.query_advice(config.advice, Rotation::cur());
vec![(advice, config.table)]
});

meta.lookup("lookup", |meta| {
let advice = meta.query_advice(config.advice, Rotation::cur());
vec![(advice, config.table)]
});

/*
- We need degree at least 6 because 6 - 1 = 5 and we need to go to extended domain of 8n
- Our goal is to get to max degree of 9 because now 9 - 1 = 8 and that will fit into domain

- base degree = table_deg + 2
- if we put input_expression_degree = 1
=> degree = base + 1 = 3 + 1 = 4
- we can batch one more with 5 more lookups
*/

config
}

fn synthesize(
&self,
config: MyConfig,
mut layouter: impl Layouter<F>,
) -> Result<(), Error> {
layouter.assign_table(
|| "8-bit table",
|mut table| {
for row in 0u64..(1 << 8) {
table.assign_cell(
|| format!("row {}", row),
config.table,
row as usize,
|| Value::known(F::from(row)),
)?;
}

Ok(())
},
)?;

layouter.assign_region(
|| "assign values",
|mut region| {
for offset in 0u64..(1 << 10) {
config.selector.enable(&mut region, offset as usize)?;
region.assign_advice(
|| format!("offset {}", offset),
config.advice,
offset as usize,
|| Value::known(F::from((offset % 256))),

Check warning on line 135 in halo2_proofs/benches/lookups.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

consider removing unnecessary double parentheses

warning: consider removing unnecessary double parentheses --> halo2_proofs/benches/lookups.rs:135:53 | 135 | ... || Value::known(F::from((offset % 256))), | ^^^^^^^^^^^^^^ | = note: `-W clippy::double-parens` implied by `-W clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens

Check warning on line 135 in halo2_proofs/benches/lookups.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary parentheses around function argument

warning: unnecessary parentheses around function argument --> halo2_proofs/benches/lookups.rs:135:53 | 135 | ... || Value::known(F::from((offset % 256))), | ^ ^ | = note: `#[warn(unused_parens)]` on by default help: remove these parentheses | 135 - || Value::known(F::from((offset % 256))), 135 + || Value::known(F::from(offset % 256)), |
)?;
}
for offset in 1u64..(1 << 10) {
config.selector.enable(&mut region, offset as usize)?;
region.assign_advice(
|| format!("offset {}", offset),
config.other_advice,
offset as usize - 1,
|| Value::known(F::from((offset % 256))),

Check warning on line 144 in halo2_proofs/benches/lookups.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

consider removing unnecessary double parentheses

warning: consider removing unnecessary double parentheses --> halo2_proofs/benches/lookups.rs:144:53 | 144 | ... || Value::known(F::from((offset % 256))), | ^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens

Check warning on line 144 in halo2_proofs/benches/lookups.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary parentheses around function argument

warning: unnecessary parentheses around function argument --> halo2_proofs/benches/lookups.rs:144:53 | 144 | ... || Value::known(F::from((offset % 256))), | ^ ^ | help: remove these parentheses | 144 - || Value::known(F::from((offset % 256))), 144 + || Value::known(F::from(offset % 256)), |
)?;
}
Ok(())
},
)
}
}

fn keygen(k: u32) -> (ParamsKZG<Bn256>, ProvingKey<G1Affine>) {
let params: ParamsKZG<Bn256> = ParamsKZG::new(k);
let empty_circuit: MyCircuit<<Bn256 as Engine>::Scalar> = MyCircuit {
_marker: PhantomData,
};
let vk = keygen_vk(&params, &empty_circuit).expect("keygen_vk should not fail");
let pk = keygen_pk(&params, vk, &empty_circuit).expect("keygen_pk should not fail");
(params, pk)
}

fn prover(k: u32, params: &ParamsKZG<Bn256>, pk: &ProvingKey<G1Affine>) -> Vec<u8> {

Check warning on line 163 in halo2_proofs/benches/lookups.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unused variable: `k`

warning: unused variable: `k` --> halo2_proofs/benches/lookups.rs:163:15 | 163 | fn prover(k: u32, params: &ParamsKZG<Bn256>, pk: &ProvingKey<G1Affine>) -> Vec<u8> { | ^ help: if this is intentional, prefix it with an underscore: `_k` | = note: `#[warn(unused_variables)]` on by default
let rng = OsRng;

let circuit: MyCircuit<<Bn256 as Engine>::Scalar> = MyCircuit {
_marker: PhantomData,
};

let mut transcript = Blake2bWrite::<_, _, Challenge255<G1Affine>>::init(vec![]);
create_proof::<KZGCommitmentScheme<Bn256>, ProverGWC<'_, Bn256>, _, _, _, _>(
params,
pk,
&[circuit],
&[&[]],
rng,
&mut transcript,
)
.expect("proof generation should not fail");
transcript.finalize()
}

fn verifier(params: &ParamsKZG<Bn256>, vk: &VerifyingKey<G1Affine>, proof: &[u8]) {
let strategy = SingleStrategy::new(params);
let mut transcript = Blake2bRead::<_, _, Challenge255<G1Affine>>::init(proof);
assert!(verify_proof::<
KZGCommitmentScheme<Bn256>,
VerifierGWC<'_, Bn256>,
Challenge255<G1Affine>,
Blake2bRead<&[u8], G1Affine, Challenge255<G1Affine>>,
SingleStrategy<'_, Bn256>,
>(params, vk, strategy, &[&[]], &mut transcript)
.is_ok());
}

let k_range = 16..=16;

let mut keygen_group = c.benchmark_group("plonk-keygen");
keygen_group.sample_size(10);
for k in k_range.clone() {
keygen_group.bench_with_input(BenchmarkId::from_parameter(k), &k, |b, &k| {
b.iter(|| keygen(k));
});
}
keygen_group.finish();

let mut prover_group = c.benchmark_group("plonk-prover");
prover_group.sample_size(10);
for k in k_range.clone() {
let (params, pk) = keygen(k);

prover_group.bench_with_input(
BenchmarkId::from_parameter(k),
&(k, &params, &pk),
|b, &(k, params, pk)| {
b.iter(|| prover(k, params, pk));
},
);
}
prover_group.finish();

let mut verifier_group = c.benchmark_group("plonk-verifier");
for k in k_range {
let (params, pk) = keygen(k);
let proof = prover(k, &params, &pk);

verifier_group.bench_with_input(
BenchmarkId::from_parameter(k),
&(&params, pk.get_vk(), &proof[..]),
|b, &(params, vk, proof)| {
b.iter(|| verifier(params, vk, proof));
},
);
}
verifier_group.finish();
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
22 changes: 22 additions & 0 deletions halo2_proofs/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@
///
/// This will use multithreading if beneficial.
pub fn best_multiexp<C: CurveAffine>(coeffs: &[C::Scalar], bases: &[C]) -> C::Curve {
#[cfg(feature = "counter")]
{
use crate::MSM_COUNTER;
*MSM_COUNTER
.lock()
.unwrap()
.entry(coeffs.len())
.and_modify(|cnt| *cnt += 1)
.or_insert(1);

Check warning on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unused unary operation that must be used

warning: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |_________________________^ the unary operation produces a value | = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 138 | let _ = *MSM_COUNTER | +++++++

Check warning on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unused unary operation that must be used

warning: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |_________________________^ the unary operation produces a value | = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 138 | let _ = *MSM_COUNTER | +++++++

Check warning on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary operation

warning: unnecessary operation --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |__________________________^ | = note: `-W clippy::unnecessary-operation` implied by `-W clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 138 ~ MSM_COUNTER 139 + .lock() 140 + .unwrap() 141 + .entry(coeffs.len()) 142 + .and_modify(|cnt| *cnt += 1) 143 + .or_insert(1); |

Check warning on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary operation

warning: unnecessary operation --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |__________________________^ | = note: `-W clippy::unnecessary-operation` implied by `-W clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 138 ~ MSM_COUNTER 139 + .lock() 140 + .unwrap() 141 + .entry(coeffs.len()) 142 + .and_modify(|cnt| *cnt += 1) 143 + .or_insert(1); |

Check failure on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unused unary operation that must be used

error: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |_________________________^ the unary operation produces a value | = note: `-D unused-must-use` implied by `-D warnings` help: use `let _ = ...` to ignore the resulting value | 138 | let _ = *MSM_COUNTER | +++++++

Check failure on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unused unary operation that must be used

error: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |_________________________^ the unary operation produces a value | = note: `-D unused-must-use` implied by `-D warnings` help: use `let _ = ...` to ignore the resulting value | 138 | let _ = *MSM_COUNTER | +++++++

Check failure on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unnecessary operation

error: unnecessary operation --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |__________________________^ | = note: `-D clippy::unnecessary-operation` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 138 ~ MSM_COUNTER 139 + .lock() 140 + .unwrap() 141 + .entry(coeffs.len()) 142 + .and_modify(|cnt| *cnt += 1) 143 + .or_insert(1); |

Check failure on line 143 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unnecessary operation

error: unnecessary operation --> halo2_proofs/src/arithmetic.rs:138:9 | 138 | / *MSM_COUNTER 139 | | .lock() 140 | | .unwrap() 141 | | .entry(coeffs.len()) 142 | | .and_modify(|cnt| *cnt += 1) 143 | | .or_insert(1); | |__________________________^ | = note: `-D clippy::unnecessary-operation` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 138 ~ MSM_COUNTER 139 + .lock() 140 + .unwrap() 141 + .entry(coeffs.len()) 142 + .and_modify(|cnt| *cnt += 1) 143 + .or_insert(1); |
}

assert_eq!(coeffs.len(), bases.len());

let num_threads = multicore::current_num_threads();
Expand Down Expand Up @@ -171,6 +182,17 @@
///
/// This will use multithreading if beneficial.
pub fn best_fft<G: Group>(a: &mut [G], omega: G::Scalar, log_n: u32) {
#[cfg(feature = "counter")]
{
use crate::FFT_COUNTER;
*FFT_COUNTER
.lock()
.unwrap()
.entry(a.len())
.and_modify(|cnt| *cnt += 1)
.or_insert(1);

Check warning on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unused unary operation that must be used

warning: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |_________________________^ the unary operation produces a value | help: use `let _ = ...` to ignore the resulting value | 188 | let _ = *FFT_COUNTER | +++++++

Check warning on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unused unary operation that must be used

warning: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |_________________________^ the unary operation produces a value | help: use `let _ = ...` to ignore the resulting value | 188 | let _ = *FFT_COUNTER | +++++++

Check warning on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary operation

warning: unnecessary operation --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 188 ~ FFT_COUNTER 189 + .lock() 190 + .unwrap() 191 + .entry(a.len()) 192 + .and_modify(|cnt| *cnt += 1) 193 + .or_insert(1); |

Check warning on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (beta)

unnecessary operation

warning: unnecessary operation --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 188 ~ FFT_COUNTER 189 + .lock() 190 + .unwrap() 191 + .entry(a.len()) 192 + .and_modify(|cnt| *cnt += 1) 193 + .or_insert(1); |

Check failure on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unused unary operation that must be used

error: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |_________________________^ the unary operation produces a value | help: use `let _ = ...` to ignore the resulting value | 188 | let _ = *FFT_COUNTER | +++++++

Check failure on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unused unary operation that must be used

error: unused unary operation that must be used --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |_________________________^ the unary operation produces a value | help: use `let _ = ...` to ignore the resulting value | 188 | let _ = *FFT_COUNTER | +++++++

Check failure on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unnecessary operation

error: unnecessary operation --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 188 ~ FFT_COUNTER 189 + .lock() 190 + .unwrap() 191 + .entry(a.len()) 192 + .and_modify(|cnt| *cnt += 1) 193 + .or_insert(1); |

Check failure on line 193 in halo2_proofs/src/arithmetic.rs

View workflow job for this annotation

GitHub Actions / Clippy (1.56.1)

unnecessary operation

error: unnecessary operation --> halo2_proofs/src/arithmetic.rs:188:9 | 188 | / *FFT_COUNTER 189 | | .lock() 190 | | .unwrap() 191 | | .entry(a.len()) 192 | | .and_modify(|cnt| *cnt += 1) 193 | | .or_insert(1); | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation help: statement can be reduced to | 188 ~ FFT_COUNTER 189 + .lock() 190 + .unwrap() 191 + .entry(a.len()) 192 + .and_modify(|cnt| *cnt += 1) 193 + .or_insert(1); |
}

let threads = multicore::current_num_threads();
let log_split = log2_floor(threads) as usize;
let n = a.len() as usize;
Expand Down
Loading
Loading