-
Notifications
You must be signed in to change notification settings - Fork 58
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
Further enhance LEM's witness generation speed #783
Conversation
Note: it would be easier to review this if many of the changes weren't cosmetic/renaming. If those are important and need to happen here, it would be simpler if the substantial changes were in isolated commits. This is just an informational note about the reviewer experience. |
86f6a88
to
198da0b
Compare
let preallocated_preimg: Vec<_> = (0..slot_type.preimg_size()) | ||
.map(|component_idx| { | ||
AllocatedNum::alloc_infallible( | ||
cs.namespace(|| format!("component {component_idx} slot {slot}")), | ||
|| F::ZERO, | ||
) | ||
}) | ||
.collect(); |
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.
Although I don't think it's introduced in this PR, it seems that the handling of preimage values is smudging the bellpepper API. When we are synthesizing shapes without data, we should not be specifying concrete values. Even if we get away with it here, this is sloppy and may end up biting us.
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.
My point is not that the above code will always run in a context where no real value exist — only that I think it sometimes will.
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.
Maybe I'm missing the point, but this is not to synthesize the shape without data. It's to synthesize slots that weren't visited during interpretation with dummy data
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.
Right, which is what I mentioned in my second comment. But the point is that when synthesizing without data, one of the two branches of this conditional will have to be taken, and they both allocate infallibly, as far as I can tell. Is there some third code path that is used to synthesize when creating a shape? If so, that's also not the standard usage.
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.
No, this is the only code that's used to create the shape. But I think this is getting into territory @gabriel-barrett understands better
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.
It has come up elsewhere, and I'm reiterating the point here.
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.
Can you create an issue for it please? I don't think I understand the problem well enough yet.
198da0b
to
b50c017
Compare
b50c017
to
3476747
Compare
3476747
to
9c7aabc
Compare
9c7aabc
to
de02574
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.
Stamping to unblock.
This PR is the result of a long iterative process of improvements on LEM's witness generation algorithm.
rayon
to generate the witnesses for all frames in parallel and it can make a better use of the CPUs than if we try to teach it how to do it💅🏼
Globals
toRecursiveContext
because it better represents its role