From 1da7347f514fcec19f31a686be6d166c7690f5f1 Mon Sep 17 00:00:00 2001 From: rudy Date: Tue, 18 Jun 2024 14:01:25 +0200 Subject: [PATCH] fix(optimizer): sync with linting update, dead code and deprecated constants --- .../src/optimization/dag/multi_parameters/feasible.rs | 6 +++--- .../src/optimization/dag/solo_key/analyze.rs | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/feasible.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/feasible.rs index c8ff041fd2..d46b710a5d 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/feasible.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/feasible.rs @@ -34,7 +34,7 @@ impl Feasible { let pbs_index = operations_variance.index.pbs(partition); let actual_pbs_variance = operations_variance.values[pbs_index]; - let mut smallest_pbs_max_variance = std::f64::MAX; + let mut smallest_pbs_max_variance = f64::MAX; for constraint in &self.undominated_constraints { let pbs_coeff = constraint.variance.coeff_pbs(partition); @@ -60,7 +60,7 @@ impl Feasible { .keyswitch_to_small(src_partition, dst_partition); let actual_ks_variance = operations_variance.values[ks_index]; - let mut smallest_ks_max_variance = std::f64::MAX; + let mut smallest_ks_max_variance = f64::MAX; for constraint in &self.undominated_constraints { let ks_coeff = constraint @@ -89,7 +89,7 @@ impl Feasible { .keyswitch_to_big(src_partition, dst_partition); let actual_fks_variance = operations_variance.values[fks_index]; - let mut smallest_fks_max_variance = std::f64::MAX; + let mut smallest_fks_max_variance = f64::MAX; for constraint in &self.undominated_constraints { let fks_coeff = constraint diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs index a42f48911f..84502b857a 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs @@ -113,7 +113,6 @@ fn variance_origin(inputs: &[OperatorIndex], out_variances: &[SymbolicVariance]) #[derive(Clone, Debug)] pub struct SoloKeyDag { - pub operators: Vec, // Collect all operators output variances pub out_variances: Vec, pub nb_luts: u64, @@ -125,9 +124,9 @@ pub struct SoloKeyDag { #[derive(Clone, Debug)] pub struct VariancesAndBound { + #[cfg(test)] pub precision: Precision, pub safe_variance_bound: f64, - pub nb_luts: u64, // All dominating final variance factor not entering a lut (usually final levelledOp) pub pareto_output: Vec, // All dominating variance factor entering a lut @@ -349,7 +348,6 @@ fn constraint_for_one_precision( ) -> VariancesAndBound { let extra_finals_variance = select_precision(target_precision, extra_final_variances); let in_luts_variance = select_precision(target_precision, in_luts_variance); - let nb_luts = in_luts_variance.len() as u64; let all_output = counted_symbolic_variance(&extra_finals_variance); let all_in_lut = counted_symbolic_variance(&in_luts_variance); let remove_shape = |t: &(Shape, SymbolicVariance)| t.1; @@ -358,9 +356,9 @@ fn constraint_for_one_precision( let pareto_vfs_final = SymbolicVariance::reduce_to_pareto_front(extra_finals_variance); let pareto_vfs_in_lut = SymbolicVariance::reduce_to_pareto_front(in_luts_variance); VariancesAndBound { + #[cfg(test)] precision: target_precision, safe_variance_bound: safe_noise_bound, - nb_luts, pareto_output: pareto_vfs_final, pareto_in_lut: pareto_vfs_in_lut, all_output, @@ -399,7 +397,6 @@ pub fn analyze(dag: &Dag, noise_config: &NoiseBoundConfig) -> SoloKeyDag { noise_config, ); let result = SoloKeyDag { - operators: dag.operators.clone(), out_variances, nb_luts, levelled_complexity,