-
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
Debug compilation for Noir programs #2128
Comments
There are a number of other optimisations which we could turn off in order to improve debugging here, e.g. the redundant range optimisation can result in an overflow not being displayed due to the fact that it's being caught later. |
An alternative approach is for tests to make the input be seen as non-constant, so that you can reproduce the exact environment one gets when a program is executed (with optimizations) |
Linking this comment (#2446 (comment)) to note another optimization that can be removed in a debug compilation mode |
In the short term (and complementary to debug mode in the future), we could add something similar to Rust's |
Problem
When working with
nargo test
, everything supplied to a function is a constant. This leads to issues as outlined in this PR: #2116, whereprintln
does not work in tests with failing constraints. Essentially a failed constraint is resolved during compilation before we ever reach execution (where theprintln
foreign call is handled).Happy Case
We should offer a
debug
compile option that does not enforce constrain instructions at compile-time. This compile option will be enabled duringnargo test
to allowprintln
to execute even with compile time constraint failures.Alternatives Considered
Otherwise
println
just will not work during failing tests which leads to inconsistent functionality withnargo execute
. No realistic alternatives.Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: