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

feat: plonk circuit optimizations #972

Merged
merged 10 commits into from
Jun 27, 2024
Merged

Conversation

kevjue
Copy link
Contributor

@kevjue kevjue commented Jun 24, 2024

No description provided.

@kevjue kevjue changed the base branch from main to dev June 24, 2024 21:23
@kevjue kevjue changed the title WIP: plonk circuit optimizations feat: plonk circuit optimizations Jun 25, 2024
@kevjue kevjue marked this pull request as ready for review June 25, 2024 18:03
@@ -103,6 +103,7 @@ pub struct Builder<C: Config> {
pub(crate) p2_hash_num: Var<C::N>,
pub(crate) debug: bool,
pub(crate) is_sub_builder: bool,
pub program_options: HashMap<String, String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is program_options and why is it a String, String? That's one of the worst data types since it offers basically no type safety

also should have a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, I'm aware of it not having any type safety. This is used for general options/flags that the user of a builder can set to read in the program (similar to environment variables, which also doesn't have any type safety).

e.g. i needed a way to tell the builder which specific exp_reverse_bit_len to use here: https://github.com/succinctlabs/sp1/pull/972/files#diff-db73ffd500d0fa7feab9026c2f484f505d78d0fea40c55448c60c055c8c3d138R127

I didn't want to add a program specific field to the builder struct, so added a general lookup table for this. Also, there are other flags with a similar need that uses this lookup table.

Copy link
Contributor Author

@kevjue kevjue Jun 25, 2024

Choose a reason for hiding this comment

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

Actually, I'll change it to a HashMap<String, bool> type, since all the existing entries are bools.

@kevjue kevjue merged commit 6cd5df6 into dev Jun 27, 2024
4 of 5 checks passed
@kevjue kevjue deleted the kevjue/plonk_circuit_optimizations branch June 27, 2024 02:25
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