-
Notifications
You must be signed in to change notification settings - Fork 219
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
chore: Experimenting with stepwise ACVM solver [DO NOT MERGE] #1729
Conversation
fcc4e3e
to
ba4f19b
Compare
@kevaundray Heads up that the new SSA code is still generating opcodes out of order. |
dad6fac
to
2fdd5fe
Compare
I'm getting failures on the program use dep::std;
fn main(x: Field, y: Field, salt: Field, out_x: Field, out_y: Field ) {
// let res = std::hash::pedersen([x, y]);
// assert(res[0] == out_x);
// assert(res[1] == out_y);
let raw_data = [x,y];
let mut state = 0;
for i in 0..2 {
state = state * 8 + raw_data[i];
}
state += salt;
let hash = std::hash::pedersen([state]);
// assert(std::hash::pedersen([43])[0] == hash[0]);
} Which results in the ACIR (pre/post optimization)
Looks like it's running into the issue of not knowing how to sort the arithmetic opcodes. I purposefully removed the existing sorting here as it results in the bad outcome as described in noir-lang/acvm#419 but it seems like the underlying logic can't handle all cases properly either (which makes sense as it has no information on which witness was the "output" of the original expression and so is now included in an expression with two unknowns. |
As a rough heuristic we should prefer to attach intermediate variables to the lowest value witnesses in the expression. |
@TomAFrench Is this still a [DO NOT MERGE] PR or will this be used for introducing stepwise execution? |
I'll probably repurpose this PR but for now it's a scratch branch while I get dynamic arrays working. |
Closing in favour of #2051 |
Description
Problem*
Resolves
Summary*
Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.