Closed guorong009 closed 4 months ago
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
andquery.rs
which have definitions that were previously inexpression.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 typesConstraint
,Constraints
,SelectorsToFixed
,Gate
and so on, which are types directly used by theConstraintSystem
atplonk/circuit/constraint_system.rs
intoplonk/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 byplonk/circuit/constraint_system.rs
are found inplonk/circuit.rs
. I think I would prefer moving those toplonk/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
1) I believe it is right to create less new files.
Hence, I remove 3 new files & create plonk/circuit/helpers.rs
file for Expression
-related contents.
2) I also think you are right.
FYI, I originally moved out all of those structs to plonk/circuit.rs
,
because they are also exported & used in halo2_proofs
crate.
But, it seems that there is no need.
I create a new file plonk/circuit/constraint_system/helpers.rs
for ConstraintSystem
-related contents.
Please check new updates & give more feedback.
Thanks for the review! @ed255
I think this PR is a bit awkward since it tries to split the code in unnatural way. It just aims to reduce the LOC, and breaks the cohesion. Plus, a new structure is not that good. How about closing the PR, without merge? (Maybe, close the issue also?)
I think this PR is a bit awkward since it tries to split the code in unnatural way. It just aims to reduce the LOC, and breaks the cohesion. Plus, a new structure is not that good. How about closing the PR, without merge? (Maybe, close the issue also?)
Closing the PR and the issue sounds good to me!
Close the PR since it leads to unnatural, incoherent refactoring. Plus, close #297 as resolved.
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.