-
Notifications
You must be signed in to change notification settings - Fork 131
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
Small updates to MockProver #256
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.
- expose InstanceValue::value() -> this is an helpful util to get the underlying value, though InstanceValue is public already
This looks good to me. - expose region data -> this is helpful to get the column annotations.
I don't think access to the annotations in this way is needed. Annotations are there only for debugging purposes for theMockProver
but nothing else. I don't see why you need access to them.
Same for a lot of the other fields. I think giving access to the Region internals can be problematic. - add conversion for Selector -> Column -> this is helpful to cast selector as a fixed column:
Due to selector-compression, not sure how efficient/secure this is. - record the last row assigned -> useful to estimate value of k:
Already addressed in the comments of the PR.
halo2_proofs/src/plonk/circuit.rs
Outdated
@@ -350,6 +350,15 @@ impl From<Column<Fixed>> for Column<Any> { | |||
} | |||
} | |||
|
|||
impl From<Selector> for Column<Any> { |
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.
Why would it be possible to cast this? How are you planning to create an Advice
or Instance
column from this?
If this stays here, it should only be valid to do:
impl From<Selector> for Column<Any> { | |
impl From<Selector> for Column<Fixed> { |
And not only that, This cast is also bad in the sense that selector_compression
will happen and I'm not sure how will affect this castings done here.
I'd remove this and not allow to do this type of cast just to be safe.
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 want to use the name_column annotation util added in #109. However it only works for advice, fixed and instance. Currently it is not possible to annotate a selector column.
This is an example where it is currently failing https://github.com/zemse/halo2-utils/blob/d36fdf2036f4300bfc2559e754b7b68909f63044/src/example_circuit.rs#L70
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.
That's correct. But there's an issue with that.
Notice that when we do keygen, we call the fn compress_selectors
.
If you have compression enabled, the annotation could be erased. Otherwise, if we prevent compression, we're not matching the circuit we will end up with.
Hence why this is an issue.
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.
Got it, I have removed this change by reverting the commit
Co-authored-by: Carlos Pérez <[email protected]>
Thanks for review
If user is annotating the columns for debugging, that can be reused to print all column assignments (for a different debugging approach), while those columns can be labeled accordingly. Here is an example of how that would look. |
This reverts commit 8cd1376.
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.
LGTM
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.
LGTM!
* expose InstanceValue::value * expose region data * add conversion for Selector -> Column<Any> * Update halo2_proofs/src/dev.rs Co-authored-by: Carlos Pérez <[email protected]> * Revert "add conversion for Selector -> Column<Any>" This reverts commit 8cd1376. --------- Co-authored-by: Carlos Pérez <[email protected]>
* expose InstanceValue::value * expose region data * add conversion for Selector -> Column<Any> * Update halo2_proofs/src/dev.rs Co-authored-by: Carlos Pérez <[email protected]> * Revert "add conversion for Selector -> Column<Any>" This reverts commit 8cd1376. --------- Co-authored-by: Carlos Pérez <[email protected]>
* expose InstanceValue::value * expose region data * add conversion for Selector -> Column<Any> * Update halo2_proofs/src/dev.rs Co-authored-by: Carlos Pérez <[email protected]> * Revert "add conversion for Selector -> Column<Any>" This reverts commit 8cd1376. --------- Co-authored-by: Carlos Pérez <[email protected]>
These changes allow something like this https://github.com/zemse/halo2-utils