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

pcs-change #130

Merged
merged 11 commits into from
Aug 21, 2024
Merged

pcs-change #130

merged 11 commits into from
Aug 21, 2024

Conversation

tnyuzg
Copy link
Collaborator

@tnyuzg tnyuzg commented Jul 31, 2024

No description provided.

Comment on lines +43 to +46
/// Distance of the linear code when avaible from linear code specification
fn distance(&self) -> Result<f64, String>;
/// Proximity gap of the linear code when avaible from linear code specification
fn proximity_gap(&self) -> Result<f64, String>;
Copy link
Member

Choose a reason for hiding this comment

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

Why use Result<f64, String>, any error we need to handle?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These functions are in CodeSpec trait, so I think some codes' distance and proximity_gap may be not available when only given the code specification.
I can remove it for simplicity.

Copy link
Member

Choose a reason for hiding this comment

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

We do not need these functions in the trait for now, could remove it.

Copy link
Collaborator Author

@tnyuzg tnyuzg Aug 7, 2024

Choose a reason for hiding this comment

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

We need these function to know distance and proximity gap of the code in BrakedownParams::new(num_vars: usize, code_spec: impl LinearCodeSpec<F, Code = C>) only from code spec instead of code itself.
So we can compute
let estimated_queries = |distance: f64, gap: f64| { ceil(-(BRAKEDOWN_SECURITY_BIT as f64) / (1.0 - distance * gap).log2()) };
before instantiating a code from code_spec.

Copy link
Member

Choose a reason for hiding this comment

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

ok, then let's change the api to output a f64 type without handling the errors.

Comment on lines +64 to +66
if num_cols > (1 << num_vars) {
num_cols = 1 << num_vars;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if num_cols > (1 << num_vars) {
num_cols = 1 << num_vars;
}
num_cols = std::cmp::min(num_cols, 1 << num_vars>>);

Copy link
Member

@xiangxiecrypto xiangxiecrypto left a comment

Choose a reason for hiding this comment

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

minor changes

@xiangxiecrypto xiangxiecrypto merged commit 0ecee58 into main Aug 21, 2024
8 checks passed
@serendipity-crypto serendipity-crypto deleted the pcs-opt branch December 6, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants