Skip to content

Commit

Permalink
test(core): make check a little less stringent on improved var for ms
Browse files Browse the repository at this point in the history
  • Loading branch information
IceTDrinker committed Feb 12, 2025
1 parent 5da6a8d commit 5bf5aff
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn check_noise_improve_modulus_switch_noise(
&mut rsc.encryption_random_generator,
);

let errors: Vec<_> = (0..number_loops)
let (ms_errors, ms_errors_improved): (Vec<_>, Vec<_>) = (0..number_loops)
.into_par_iter()
.map(|_| {
let lwe = TEST_RESOURCES.with(|rsc| {
Expand Down Expand Up @@ -421,16 +421,7 @@ fn check_noise_improve_modulus_switch_noise(
}),
)
})
.collect();

let mut ms_errors = vec![];

let mut ms_errors_improved = vec![];

for (ms_error, ms_error_improved) in errors {
ms_errors.push(ms_error);
ms_errors_improved.push(ms_error_improved);
}
.unzip();

println!(
"mean(&ms_errors) {}2^{:.2}",
Expand Down Expand Up @@ -479,7 +470,7 @@ fn check_noise_improve_modulus_switch_noise(
let expected_variance_improved = expected_variance_improved.0;

assert!(
check_both_ratio_under(variance_improved, expected_variance_improved, 1.01_f64),
check_both_ratio_under(variance_improved, expected_variance_improved, 1.03_f64),
"Expected {expected_variance_improved}, got {variance_improved}",
);
}

0 comments on commit 5bf5aff

Please sign in to comment.