-
Notifications
You must be signed in to change notification settings - Fork 16
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.
Generally looks good.
If we're being lazy about this rather than having the two passes be
- Build a mapping from witness to strictest
num_bits
. - Iterate through opcodes, get minimal
num_bits
, check opcode hasn't already been added for witness already, retain opcode and mark witness as seen
We could change it to be:
- Build a mapping from witness to range opcode index with strictest
num_bits
.
1.a. convert mapping to a HashSet of opcode indices to retain. - Iterate through opcode discarding any range opcodes with indices not in the set.
The benefits probably aren't worth the extra time to change however.
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>
Yeah I was thinking of being smart by not doing a double pass, but I just went with the simplest version now and then if we see it as a bottle-neck, can change to a more optimized version |
Co-authored-by: Tom French <[email protected]>
Actually yeah, we don't need to do a double pass at all. I was thinking you were going through the effort of not just bunging the range opcodes at the end as ideally we maintain the ordering of opcodes (as this minimises loops through the circuit looking for solvable opcodes) but range opcodes don't have any outputs so this isn't a concern. |
Related issue(s)
Resolves #218
(If it does not already exist, first create a GitHub issue that describes the problem this Pull Request (PR) solves before creating the PR and link it here.)
Resolves (link to issue)
Description
Summary of changes
(Describe the changes in this PR. Point out breaking changes if any.)
Dependency additions / changes
(If applicable.)
Test additions / changes
(If applicable.)
Checklist
cargo fmt
with default settings.Additional context
(If applicable.)