-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description ## Problem\* * Need to check that type constants fit into their `Kind`'s * The sizes of results from `op.function` and `evaluate_to_u32` are unchecked ## Summary\* Split out from #6094 - Some parts only work with its additional kind information - Several follow up issues, including: * #6247 * #6245 * #6238 ## Additional Context TODO: - [x] Add this test and/or similar execution tests unless we already have a similar one (sanity-check that global `Field` arithmetic works past `u32::MAX`) ```noir // 2^32 + 1 global A: Field = 4294967297; global B: Field = 4294967297; global C: Field = A + B; fn main() { // 2 * (2^32 + 1) assert(C == 8589934594); let mut leading_zeroes = 0; let mut stop = false; let bits: [u1; 64] = C.to_be_bits(); for i in 0..64 { if (bits[i] == 0) & !stop { leading_zeroes += 1; } else { stop = true; } } let size = 64 - leading_zeroes; // 8589934594 has 34 bits assert(size == 34); } ``` ## 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. --------- Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Maxim Vezenov <mvezenov@gmail.com> Co-authored-by: jfecher <jake@aztecprotocol.com>
- Loading branch information
1 parent
7cc7197
commit 6e40f62
Showing
20 changed files
with
767 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.