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

chore(test): lower p_value_limit to decrease test failure probability #1787

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion tfhe/src/integer/oprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pub(crate) mod test {
fn oprf_test_uniformity_ci_run_filter() {
let sample_count: usize = 10_000;

let p_value_limit: f64 = 0.001;
let p_value_limit: f64 = 0.000_01;

Comment on lines -302 to 303
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how much does this slow the test down ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at all, the number of samples has not changed
It's just more permissive

This new value is a bit arbitrary, like the previous one was

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, what sort of impact does this have on the "tolerance" ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this is better than the test_random_from_distribution_custom_mod test function that verifies the actual p-value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decreasing the p_value_limit means there are less false positives (test fails where it shouldn't) but more false negatives.
False positives rate is the p_value_limit which is well known.
False negative rates depend on the real distribution (if it's not uniform). It's hard to quantify since we don't know what this distribution is.

For a fixed p_value_limit, increasing the number of samples reduces the false negative rates (of all other distributions) but again it's hard to quantify.

So it's hard to know by how much the number of samples needs to be increased to compensate for the decrease of the p_value_limit impact on the false negative rates.

Compared to combining n sub-tests (while keeping the same total number of samples), we can detect correlated deviations in sample-sets of sub-tests which individually appear plausible (even when combined as if they were independent) but when analyzed together are much less plausible, which means the detection is finer.

let random_bits_count = 3;

Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/shortint/oprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub(crate) mod test {
fn oprf_test_uniformity_ci_run_filter() {
let sample_count: usize = 100_000;

let p_value_limit: f64 = 0.001;
let p_value_limit: f64 = 0.000_01;

use crate::shortint::gen_keys;
use crate::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS;
Expand Down
Loading