-
Notifications
You must be signed in to change notification settings - Fork 244
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
Inconsistent output on calling function with same args #3607
Comments
After a lot of efforts and sweating, I managed to strip this issue down to a minimal example (30 opcodes):
Executing this program fails, but if you comment the first
When it fails, it prints 0x0 (which is not correct), and when it succeed (by commenting the first |
# Description ## Problem\* Resolves #3607 ## Summary\* Identical divisions happening in both 'else' and 'then' should not be simplified, because the non-taken branch will output (0,0) instead of the division result. ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
Aim
Getting this weird error where the same function results in a different output based on whether it's called directly or inside a complex call stack
Expected Behavior
Output should be the same
Bug
The
shl1
functoin in noir-bigint shifts a BigInt left by 1 bit.Running it on a constant input gives the right result
While when it is called from within
div
, it outputs0
which is wrongTo Reproduce
git clone https://github.com/shuklaayush/noir-bigint.git
git checkout bug/inconsistent-shl1
nargo test shl6 --show-output
nargo test div3 --show-output
and see last logInstallation Method
Binary
Nargo Version
nargo version = 0.19.4 noirc version = 0.19.4+1ef854686a416eb547cc0919d669627f43d01450 (git version hash: 1ef8546, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
Maybe
Support Needs
No response
The text was updated successfully, but these errors were encountered: