You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using no_predicates in a poseidon function to make it more performant in acir, but also use it in unconstrained functions.
Expected Behavior
It should compile
Bug
The application panicked (crashed).
Message: not yet implemented: enable_side_effects not supported by brillig
Location: compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs:701
To Reproduce
use dep::std::hash::{pedersen_hash_with_separator, poseidon2::Poseidon2};
global NUM_HASHES = 2;
global HASH_LENGTH = 10;#[no_predicates]pubfnposeidon_hash<N>(inputs:[Field;N]) -> Field{Poseidon2::hash(inputs, inputs.len())}
unconstrained fnmain(to_hash:[[Field;HASH_LENGTH];NUM_HASHES],enable:[bool;NUM_HASHES]) -> pub [Field;NUM_HASHES + 1]{letmut result = [0;NUM_HASHES + 1];for i in0..NUM_HASHES{let enable = enable[i];let to_hash = to_hash[i];if enable {
result[i] = poseidon_hash(to_hash);}}// We want to make sure that the function marked with `#[no_predicates]` with a numeric generic// is monomorphized correctly.letmut double_preimage = [0;20];for i in0..HASH_LENGTH*2{
double_preimage[i] = to_hash[0][i % HASH_LENGTH];}
result[NUM_HASHES] = poseidon_hash(double_preimage);
result
}
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
This is caused because the inliner leaves the poseidon_hash acir function existing since it's no predicates, and then it's flattened. But a flattened function isn't convertible to brillig, so brillig_gen fails trying to generate brillig code for it
# Description
## Problem\*
Resolves#5010
## Summary\*
Ignores no predicates for brillig functions to avoid trying to convert
to brillig flattened functions.
## Additional Context
## Documentation\*
Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** 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
Using no_predicates in a poseidon function to make it more performant in acir, but also use it in unconstrained functions.
Expected Behavior
It should compile
Bug
To Reproduce
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: