Skip to content
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

Not using the final SSA in order to generate the Brillig in build artifact #7157

Open
michaeljklein opened this issue Jan 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@michaeljklein
Copy link
Contributor

Aim

Attempted to benchmark that the number of executed Brillig opcodes was the same across nargo versions that produce identical SSA.

Expected Behavior

Expected that the number of opcodes would be the same or else that we have made improvements to the number of opcodes executed.

Bug

In #6981, I found a case where the final SSA is identical between two versions, but we're not using the final SSA in order to generate the Brillig that ends up in the build artifact.

This appears to be since the following two passes are being run on Brillig functions in optimize_into_acir while assuming that they'll only run on ACIR:

If you look at the SSA printed out by nargo compile --force-brillig --inliner-aggressiveness 0 --show-ssa-pass "Array Set Optimizations" then you'll see:

 v88 = call f17(Field 14259716012876109752) -> [u8; 8]
 v90 = call f17(Field 709817942659952767) -> [u8; 8]

and we then get an extra function

brillig(inline) fn to_le_bytes f17 {

  b0(v2: Field):

    v5 = call to_le_radix(v2, u32 256) -> [u8; 8]

    return v5

}

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the bug Something isn't working label Jan 22, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant