-
Notifications
You must be signed in to change notification settings - Fork 16
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
Recognise create_witin
can't fail
#488
Conversation
0f71c85
to
5176ab2
Compare
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.
If everyone is happy with the scope of this simplification to the WitIn constructor (I think it's a reasonable change), the PR looks good to me overall.
One revision requested: make the id increment operation checked or panicking in CircuitBuilder::create_witin
, and possibly extend the id type to 32 bits.
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.
Looks good, thanks for taking a look at the WitIn id question!
let wit_in = WitIn { | ||
id: { | ||
let id = self.num_witin; | ||
self.num_witin += 1; | ||
self.num_witin = self.num_witin.strict_add(1); |
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.
Isn't the strict_add
a nightly-only experimental API?
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.
Yes, it is. We already use a few other features like that.
This specific one would be easy to remove in the future, if we ever want to move to a stable version that doesn't have it.
Extracted from #466 and addressing https://github.com/scroll-tech/ceno/pull/455/files#r1818907561