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

Use only canonic domains #463

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Mar 13, 2024

This change is Reviewable

Copy link

graphite-app bot commented Mar 13, 2024

Your org has enabled the Graphite merge queue for merging into dev

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.43%. Comparing base (6443804) to head (4dc88e9).

Additional details and impacted files
@@              Coverage Diff              @@
##           Revert448     #463      +/-   ##
=============================================
- Coverage      95.47%   95.43%   -0.04%     
=============================================
  Files             59       59              
  Lines           8795     8699      -96     
  Branches        8795     8699      -96     
=============================================
- Hits            8397     8302      -95     
+ Misses           350      347       -3     
- Partials          48       50       +2     

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

@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 583dc1f to 43bf94c Compare March 18, 2024 11:22
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 43bf94c to 42092e2 Compare March 19, 2024 12:25
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 42092e2 to 7f63d38 Compare March 19, 2024 14:01
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 7f63d38 to 69b2fb9 Compare March 19, 2024 14:26
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 69b2fb9 to 6c0f065 Compare March 19, 2024 14:38
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 6c0f065 to 38b36f9 Compare March 19, 2024 14:48
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 38b36f9 to 2b184d6 Compare March 19, 2024 14:52
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 2b184d6 to 4dc88e9 Compare March 19, 2024 15:22
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 10 files at r1, 3 of 7 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: 9 of 10 files reviewed, 6 unresolved discussions (waiting on @spapinistarkware)


src/core/air/evaluation.rs line 172 at r3 (raw file):

                cols: values.cols.map(|c| {
                    CPUCircleEvaluation::<_, BitReversedOrder>::new(
                        CanonicCoset::new(log_size as u32).circle_domain(),

Suggestion:

CanonicCoset::new(log_size).circle_domain()

src/core/air/evaluation.rs line 307 at r3 (raw file):

        for (log_size, values) in pairs.into_iter() {
            res = res * alpha
                + CPUCircleEvaluation::new(CanonicCoset::new(log_size).circle_domain(), values)

IMO keep the constraint_evaluation_domain function
and put this code inside

Code quote:

CanonicCoset::new(log_size).circle_domain()

src/core/poly/circle/domain.rs line 110 at r3 (raw file):

    #[test]
    fn test_circle_domain_iterator() {

I think that you should change this test to work with CanonicCoset circle domain.
Do we have another test for the iterator?

Code quote:

fn test_circle_domain_iterator() {

src/fibonacci/component.rs line 108 at r3 (raw file):

                let res = self.step_constraint_eval_quotient_by_mask(point, &mask);
                accum.accumulate(bit_reverse_index(i + off, constraint_log_degree_bound), res);
                let res = self.boundary_constraint_eval_quotient_by_mask(point, &[mask[0]]);

I think that res should be renamed

Code quote:

                let res = self.step_constraint_eval_quotient_by_mask(point, &mask);
                accum.accumulate(bit_reverse_index(i + off, constraint_log_degree_bound), res);
                let res = self.boundary_constraint_eval_quotient_by_mask(point, &[mask[0]]);

src/fibonacci/component.rs line 113 at r3 (raw file):

        // Boundary constraint.
        let constraint_log_degree_bound = trace_domain.log_size();

Why did this code go?

Code quote:

        // Boundary constraint.
        let constraint_log_degree_bound = trace_domain.log_size();

src/fibonacci/component.rs line 130 at r3 (raw file):

        let res = self
            .boundary_constraint_eval_quotient_by_mask(point, &mask[0][..1].try_into().unwrap());
        let constraint_log_degree_bound = self.log_size + 1;

huh?

Code quote:

self.log_size + 1

Copy link
Contributor Author

@spapinistarkware spapinistarkware 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: 9 of 10 files reviewed, 6 unresolved discussions (waiting on @shaharsamocha7)


src/core/air/evaluation.rs line 172 at r3 (raw file):

                cols: values.cols.map(|c| {
                    CPUCircleEvaluation::<_, BitReversedOrder>::new(
                        CanonicCoset::new(log_size as u32).circle_domain(),

It's usize


src/core/air/evaluation.rs line 307 at r3 (raw file):

Previously, shaharsamocha7 wrote…

IMO keep the constraint_evaluation_domain function
and put this code inside

It's not the constraint evalaution domain no more. What name should I give it then?


src/core/poly/circle/domain.rs line 110 at r3 (raw file):

Previously, shaharsamocha7 wrote…

I think that you should change this test to work with CanonicCoset circle domain.
Do we have another test for the iterator?

Done.


src/fibonacci/component.rs line 108 at r3 (raw file):

Previously, shaharsamocha7 wrote…

I think that res should be renamed

Done.


src/fibonacci/component.rs line 113 at r3 (raw file):

Previously, shaharsamocha7 wrote…

Why did this code go?

The 2 constraints are now computed on the same domain


src/fibonacci/component.rs line 130 at r3 (raw file):

Previously, shaharsamocha7 wrote…

huh?

Now both constraints are computed on the same domain. These sizes should match the sizes in eval_on_domain

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 r4, all commit messages.
Reviewable status: 9 of 10 files reviewed, 3 unresolved discussions (waiting on @spapinistarkware)


src/core/poly/circle/domain.rs line 110 at r3 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

Done.

Using a CanonicCoset?
Actually CanonicCoset iteration can be done in two ways (right?), so maybe the test can be better.


src/fibonacci/component.rs line 128 at r4 (raw file):

        evaluation_accumulator: &mut PointEvaluationAccumulator,
    ) {
        let constraint_log_degree_bound = self.log_size + 1;

Suggestion:

let constraints_log_degree_bound = self.log_size + 1;

src/fibonacci/component.rs line 133 at r4 (raw file):

            self.step_constraint_eval_quotient_by_mask(point, &mask[0][..].try_into().unwrap()),
        );
        let constraint_log_degree_bound = self.log_size + 1;

Remove

Code quote:

let constraint_log_degree_bound = self.log_size + 1;

@spapinistarkware spapinistarkware changed the base branch from Revert448 to dev March 21, 2024 09:14
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 004de96 to 07a69ae Compare March 21, 2024 09:14
Copy link
Contributor Author

@spapinistarkware spapinistarkware 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: 6 of 10 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)


src/fibonacci/component.rs line 128 at r4 (raw file):

        evaluation_accumulator: &mut PointEvaluationAccumulator,
    ) {
        let constraint_log_degree_bound = self.log_size + 1;

Done.


src/fibonacci/component.rs line 133 at r4 (raw file):

Previously, shaharsamocha7 wrote…

Remove

Done.

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 4 of 4 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)

Copy link
Contributor Author

spapinistarkware commented Mar 21, 2024

Merge activity

@spapinistarkware spapinistarkware merged commit 4ed11e9 into dev Mar 21, 2024
18 checks passed
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