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

Organize errors. #523

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Organize errors. #523

merged 1 commit into from
Mar 26, 2024

Conversation

alonh5
Copy link
Contributor

@alonh5 alonh5 commented Mar 21, 2024

This change is Reviewable

Copy link
Contributor Author

alonh5 commented Mar 21, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @alonh5 and the rest of your teammates on Graphite Graphite

@alonh5 alonh5 marked this pull request as ready for review March 21, 2024 15:05
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alonh5 and @spapinistarkware)


src/core/commitment_scheme/mod.rs line 377 at r1 (raw file):

                let values = queried_values.take(1 << subdomain.log_size).collect_vec();
                if values.len() != 1 << subdomain.log_size {
                    return Err(VerificationError::InvalidStructure(

Do we want to return also the values/values len?

Code quote:

VerificationError::InvalidStructure(

src/core/prover/mod.rs line 146 at r1 (raw file):

    let (trace_oods_values, composition_oods_value) =
        proved_values_to_mask(air, proof.commitment_scheme_proof.proved_values.clone())
            .map_err(|_| VerificationError::InvalidStructure("Proved values".to_string()))?;

I think that this returned error string isn't really indicative. Maybe we should be able to infer in which phase of the algorithm it failed?

Code quote:

"Proved values".to_string()

src/core/prover/mod.rs line 157 at r1 (raw file):

}

fn proved_values_to_mask(

Document

Code quote:

fn proved_values_to_mask(

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch from 5e14342 to 6454dab Compare March 25, 2024 08:26
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 95.09%. Comparing base (8a75935) to head (5ed50a5).
Report is 6 commits behind head on dev.

Files Patch % Lines
src/core/commitment_scheme/verifier.rs 60.00% 3 Missing and 1 partial ⚠️
src/core/prover/mod.rs 81.25% 0 Missing and 3 partials ⚠️
src/fibonacci/mod.rs 75.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #523      +/-   ##
==========================================
- Coverage   95.17%   95.09%   -0.08%     
==========================================
  Files          63       63              
  Lines        9227     9241      +14     
  Branches     9227     9241      +14     
==========================================
+ Hits         8782     8788       +6     
- Misses        387      389       +2     
- Partials       58       64       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 4 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7 and @spapinistarkware)


src/core/prover/mod.rs line 146 at r1 (raw file):

Previously, shaharsamocha7 wrote…

I think that this returned error string isn't really indicative. Maybe we should be able to infer in which phase of the algorithm it failed?

It's not exactly failing in a certain phase, the structure of the passed proved values (oods values) isn't as expected. I modified the error message a bit, I think being more specific than this might be an overkill. WDYT?


src/core/prover/mod.rs line 157 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Document

Done.


src/core/commitment_scheme/mod.rs line 377 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Do we want to return also the values/values len?

values here is is only the values of a specific subdomain in the iteration. I can calculate the actual total difference in queried values just for this error. Thinking of the possible reasons this error could occur I'm not sure if this extra information will actually help the user.

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch 2 times, most recently from e054137 to ef7d33d Compare March 25, 2024 09:32
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @spapinistarkware)


src/core/prover/mod.rs line 146 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

It's not exactly failing in a certain phase, the structure of the passed proved values (oods values) isn't as expected. I modified the error message a bit, I think being more specific than this might be an overkill. WDYT?

maybe proved_values or (sampled)


src/core/commitment_scheme/mod.rs line 377 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

values here is is only the values of a specific subdomain in the iteration. I can calculate the actual total difference in queried values just for this error. Thinking of the possible reasons this error could occur I'm not sure if this extra information will actually help the user.

E.g. if the values vector is empty that would give an extra information.
Maybe only print the len()?

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch from ef7d33d to c00f991 Compare March 25, 2024 15:57
Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7 and @spapinistarkware)


src/core/prover/mod.rs line 146 at r1 (raw file):

Previously, shaharsamocha7 wrote…

maybe proved_values or (sampled)

Done.


src/core/commitment_scheme/mod.rs line 377 at r1 (raw file):

Previously, shaharsamocha7 wrote…

E.g. if the values vector is empty that would give an extra information.
Maybe only print the len()?

WDYT?

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch from c00f991 to c125e73 Compare March 25, 2024 16:04
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r2, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @spapinistarkware)


src/core/commitment_scheme/verifier.rs line 143 at r4 (raw file):

    value: SecureField,
) -> Result<SparseCircleEvaluation<SecureField>, VerificationError> {
    let queried_values_len = queried_values.len();

I would calculate that only if the error has happened.

Code quote:

let queried_values_len = queried_values.len();

src/core/commitment_scheme/verifier.rs line 152 at r4 (raw file):

                if values.len() != 1 << subdomain.log_size {
                    return Err(VerificationError::InvalidStructure(format!(
                        "Insufficient number of queried values ({queried_values_len})"

not sure that this value help to understand the error message by itself.
Either also print expected number or values, or remove at all (your call)

Code quote:

{queried_values_len}

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch from c125e73 to 5ed50a5 Compare March 26, 2024 09:00
Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7 and @spapinistarkware)


src/core/commitment_scheme/verifier.rs line 152 at r4 (raw file):

Previously, shaharsamocha7 wrote…

not sure that this value help to understand the error message by itself.
Either also print expected number or values, or remove at all (your call)

To calculate the expected number I would need to iterate over the domains again, calculate and sum the sized of each one. I think this is an overkill for values that won't give much information anyways, I'll just remove it from the error.

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r5.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @spapinistarkware)

@alonh5 alonh5 force-pushed the 03-21-organize_errors branch from 5ed50a5 to d198cb2 Compare March 26, 2024 09:34
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)

@alonh5 alonh5 merged commit 822f10d into dev Mar 26, 2024
12 checks passed
@alonh5 alonh5 deleted the 03-21-organize_errors branch March 26, 2024 09:48
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.

3 participants