-
Notifications
You must be signed in to change notification settings - Fork 129
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
chore: break big files into smaller ones #316
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes look good to me but I have two comments:
The first is that I see the new files column.rs
, phase.rs
and query.rs
which have definitions that were previously in expression.rs
. I notice that these new files are very small. Could they be merged in a single file?
The other comment is related to plonk/circuit.rs
. To me it feels strange to move the types Constraint
, Constraints
, SelectorsToFixed
, Gate
and so on, which are types directly used by the ConstraintSystem
at plonk/circuit/constraint_system.rs
into plonk/circuits.rs
which is a more general module. In my mind, the more general things are in less deep modules, and more specific things are in more deep modules; so it's strange to see that types that are used specifically by plonk/circuit/constraint_system.rs
are found in plonk/circuit.rs
. I think I would prefer moving those to plonk/circuit/constraint_system/foo.rs
instead.
Please let me know your thoughts about these two points. To me the second one is more important to discuss and resolve; the first one could be more related to personal taste.
Thanks for suggestions! @ed255
Please check new updates & give more feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% convinced about naming the new modules "helpers", as it looks like a generic placeholder, but I can't think of anything better 🤔
Apart from that, LGTM!
Thanks for the review! @ed255 I think this PR is a bit awkward since it tries to split the code in unnatural way. |
Closing the PR and the issue sounds good to me! |
Close the PR since it leads to unnatural, incoherent refactoring. |
Description
Break the big files(> 1k LOC) into smaller files
Related issues
Changes
halo2_frontend/src/plonk/circuit
dir../plonk/circuit/helpers.rs
&../plonk/circuit/constraint_system/helpers.rs
expression.rs
&constraint_system.rs
to new fileshalo2_frontend/src/circuit.rs
filewitness_collector.rs
insidehalo2_frontend/src/circuit/
dirNOTE
There are additional big files -
halo2_frontend/src/dev.rs
&halo2_backend/src/plonk/prover.rs
.I believe they don't need splitting, since they include only what's needed.