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

Change the starting point of logup elements #837

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

weikengchen
Copy link
Contributor

@weikengchen weikengchen commented Sep 17, 2024

This PR changes how the alpha powers are being applied to the values. In addition, the number of lookup elements needed for the Poseidon example is indeed only N_STATE rather than N_STATE * 2 as previously defined.


This change is Reviewable

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 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @weikengchen)


crates/prover/src/constraint_framework/logup.rs line 264 at r1 (raw file):

            Fraction::new(SecureField::one(), SecureField::one()),
        );
    }

Can you add this test here?

Suggestion:

    }
    
    #[test]
    fn test_lookup_elements_combine() {
        let mut channel = Blake2sChannel::default();
        let lookup_elements = LookupElements::<3>::draw(&mut channel);
        let values = [
            BaseField::from_u32_unchecked(123),
            BaseField::from_u32_unchecked(456),
            BaseField::from_u32_unchecked(789),
        ];

        assert_eq!(
            lookup_elements.combine::<BaseField, SecureField>(&values),
            BaseField::from_u32_unchecked(123)
                + BaseField::from_u32_unchecked(456) * lookup_elements.alpha
                + BaseField::from_u32_unchecked(789) * lookup_elements.alpha.pow(2)
                - lookup_elements.z
        );
    }

@weikengchen
Copy link
Contributor Author

@shaharsamocha7 The test has been added.

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

@shaharsamocha7 shaharsamocha7 merged commit a51f630 into starkware-libs:dev Sep 17, 2024
1 check passed
jarnesino pushed a commit to jarnesino/stwo that referenced this pull request Sep 17, 2024
* modify logup elements

* add the test

* fmt
jarnesino pushed a commit to jarnesino/stwo that referenced this pull request Sep 17, 2024
* modify logup elements

* add the test

* fmt
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