chore: Add u1 ops to interpreter, convert Value panics to errors#8469
chore: Add u1 ops to interpreter, convert Value panics to errors#8469
Conversation
There was a problem hiding this comment.
There are still some problems with this. I'm testing after merging into my branch, and getting a failure like this:
Internal(ConstantDoesNotFitInType { constant: 18446744073709551588, typ: Unsigned { bit_size: 8 } })
It's trying to cast i64 of -28 to u8. The problem is that interpret_instruction handling Cast first converts the NumericValue to Field, where we now use the signedness, but then treats that Field as if it was the target type.
|
Added an test to show the above error in 09e8403 |
…ng/noir into jf/interpreter-additions
|
@aakoshh should be fixed now |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: b4dede8 | Previous: 9c53936 | Ratio |
|---|---|---|---|
rollup-root |
2.05 s |
1.666 s |
1.23 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
What exactly do we mean by "sign-extend" and "zero-extend"? |
It refers to the values in binary when you have -1 as an i8 it looks like zero-extend is to fill it with zeroes: zero-extending a value like -1 as i8 into a i32 would produce Edit: This is also why given |
aakoshh
left a comment
There was a problem hiding this comment.
This shall be our spec 📖 👨⚖️
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(licm): Account for nested loops being control dependent when analyzing outer loops (noir-lang/noir#8593) chore(refactor): Switch unreachable function removal to use centralized call graph (noir-lang/noir#8578) chore(test): Allow lambdas in fuzzing (noir-lang/noir#8584) chore: use insta for execution_success stdout (noir-lang/noir#8576) chore: use generator instead of zero for ec-add predicate (noir-lang/noir#8552) fix: use predicate expression as binary result (noir-lang/noir#8583) fix(ssa): Do not generate apply functions when no lambda variants exist (noir-lang/noir#8573) chore: put `nargo expand` snapshosts in the same directory (noir-lang/noir#8577) chore: Use FxHashMap for TypeBindings (noir-lang/noir#8574) chore(experimental): use larger stack size for parsing (noir-lang/noir#8347) chore: use insta snapshots for compile_failure stderr (noir-lang/noir#8569) chore(inlining): Mark functions with <= 10 instructions and no control flow as inline always (noir-lang/noir#8533) chore(ssa): Add weighted edges to call graph, move callers and callees methods to call graph (noir-lang/noir#8513) fix(frontend): Override to allow empty array input (noir-lang/noir#8568) fix: avoid logging all unused params in DIE pass (noir-lang/noir#8566) chore: bump external pinned commits (noir-lang/noir#8562) chore(deps): bump base-x from 3.0.9 to 3.0.11 (noir-lang/noir#8555) chore(fuzz): Call function pointers (noir-lang/noir#8531) feat: C++ codegen for msgpack (noir-lang/noir#7716) feat(performance): brillig array set optimization (noir-lang/noir#8550) chore(fuzz): AST fuzzer to use function valued arguments (Part 1) (noir-lang/noir#8514) fix(licm): Check whether the loop is executed when hoisting with a predicate (noir-lang/noir#8546) feat: Implement $crate (noir-lang/noir#8537) fix: add offset to ArrayGet (noir-lang/noir#8536) chore: remove some unused enum variants and functions (noir-lang/noir#8538) fix: disallow `()` in entry points (noir-lang/noir#8529) chore: Remove println in ssa interpreter (noir-lang/noir#8528) fix: don't overflow when casting signed value to u128 (noir-lang/noir#8526) chore(performance): Enable hoisting pure with predicate calls (noir-lang/noir#8522) feat(fuzz): AST fuzzing with SSA interpreter (noir-lang/noir#8436) chore: Add u1 ops to interpreter, convert Value panics to errors (noir-lang/noir#8469) chore: Release Noir(1.0.0-beta.6) (noir-lang/noir#8438) chore(fuzz): AST generator to add `ctx_limit` to all functions (noir-lang/noir#8507) fix(inlining): Use centralized CallGraph structure for inline info computation (noir-lang/noir#8489) fix: remove private builtins from `Field` impl (noir-lang/noir#8496) feat: primitive types are no longer keywords (noir-lang/noir#8470) fix: parenthesized pattern, and correct 1-element tuple printing (noir-lang/noir#8482) fix: fix visibility of methods in `std::meta` (noir-lang/noir#8497) fix: Change `can_be_main` to be recursive (noir-lang/noir#8501) chore: add SSA interpreter test for higher order functions (noir-lang/noir#8486) fix(frontend)!: Ban zero sized arrays and strings as program input (noir-lang/noir#8491) fix!: remove `to_be_radix` and `to_le_radix` from stdlib interface (noir-lang/noir#8495) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(licm): Account for nested loops being control dependent when analyzing outer loops (noir-lang/noir#8593) chore(refactor): Switch unreachable function removal to use centralized call graph (noir-lang/noir#8578) chore(test): Allow lambdas in fuzzing (noir-lang/noir#8584) chore: use insta for execution_success stdout (noir-lang/noir#8576) chore: use generator instead of zero for ec-add predicate (noir-lang/noir#8552) fix: use predicate expression as binary result (noir-lang/noir#8583) fix(ssa): Do not generate apply functions when no lambda variants exist (noir-lang/noir#8573) chore: put `nargo expand` snapshosts in the same directory (noir-lang/noir#8577) chore: Use FxHashMap for TypeBindings (noir-lang/noir#8574) chore(experimental): use larger stack size for parsing (noir-lang/noir#8347) chore: use insta snapshots for compile_failure stderr (noir-lang/noir#8569) chore(inlining): Mark functions with <= 10 instructions and no control flow as inline always (noir-lang/noir#8533) chore(ssa): Add weighted edges to call graph, move callers and callees methods to call graph (noir-lang/noir#8513) fix(frontend): Override to allow empty array input (noir-lang/noir#8568) fix: avoid logging all unused params in DIE pass (noir-lang/noir#8566) chore: bump external pinned commits (noir-lang/noir#8562) chore(deps): bump base-x from 3.0.9 to 3.0.11 (noir-lang/noir#8555) chore(fuzz): Call function pointers (noir-lang/noir#8531) feat: C++ codegen for msgpack (noir-lang/noir#7716) feat(performance): brillig array set optimization (noir-lang/noir#8550) chore(fuzz): AST fuzzer to use function valued arguments (Part 1) (noir-lang/noir#8514) fix(licm): Check whether the loop is executed when hoisting with a predicate (noir-lang/noir#8546) feat: Implement $crate (noir-lang/noir#8537) fix: add offset to ArrayGet (noir-lang/noir#8536) chore: remove some unused enum variants and functions (noir-lang/noir#8538) fix: disallow `()` in entry points (noir-lang/noir#8529) chore: Remove println in ssa interpreter (noir-lang/noir#8528) fix: don't overflow when casting signed value to u128 (noir-lang/noir#8526) chore(performance): Enable hoisting pure with predicate calls (noir-lang/noir#8522) feat(fuzz): AST fuzzing with SSA interpreter (noir-lang/noir#8436) chore: Add u1 ops to interpreter, convert Value panics to errors (noir-lang/noir#8469) chore: Release Noir(1.0.0-beta.6) (noir-lang/noir#8438) chore(fuzz): AST generator to add `ctx_limit` to all functions (noir-lang/noir#8507) fix(inlining): Use centralized CallGraph structure for inline info computation (noir-lang/noir#8489) fix: remove private builtins from `Field` impl (noir-lang/noir#8496) feat: primitive types are no longer keywords (noir-lang/noir#8470) fix: parenthesized pattern, and correct 1-element tuple printing (noir-lang/noir#8482) fix: fix visibility of methods in `std::meta` (noir-lang/noir#8497) fix: Change `can_be_main` to be recursive (noir-lang/noir#8501) chore: add SSA interpreter test for higher order functions (noir-lang/noir#8486) fix(frontend)!: Ban zero sized arrays and strings as program input (noir-lang/noir#8491) fix!: remove `to_be_radix` and `to_le_radix` from stdlib interface (noir-lang/noir#8495) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(licm): Account for nested loops being control dependent when analyzing outer loops (noir-lang/noir#8593) chore(refactor): Switch unreachable function removal to use centralized call graph (noir-lang/noir#8578) chore(test): Allow lambdas in fuzzing (noir-lang/noir#8584) chore: use insta for execution_success stdout (noir-lang/noir#8576) chore: use generator instead of zero for ec-add predicate (noir-lang/noir#8552) fix: use predicate expression as binary result (noir-lang/noir#8583) fix(ssa): Do not generate apply functions when no lambda variants exist (noir-lang/noir#8573) chore: put `nargo expand` snapshosts in the same directory (noir-lang/noir#8577) chore: Use FxHashMap for TypeBindings (noir-lang/noir#8574) chore(experimental): use larger stack size for parsing (noir-lang/noir#8347) chore: use insta snapshots for compile_failure stderr (noir-lang/noir#8569) chore(inlining): Mark functions with <= 10 instructions and no control flow as inline always (noir-lang/noir#8533) chore(ssa): Add weighted edges to call graph, move callers and callees methods to call graph (noir-lang/noir#8513) fix(frontend): Override to allow empty array input (noir-lang/noir#8568) fix: avoid logging all unused params in DIE pass (noir-lang/noir#8566) chore: bump external pinned commits (noir-lang/noir#8562) chore(deps): bump base-x from 3.0.9 to 3.0.11 (noir-lang/noir#8555) chore(fuzz): Call function pointers (noir-lang/noir#8531) feat: C++ codegen for msgpack (noir-lang/noir#7716) feat(performance): brillig array set optimization (noir-lang/noir#8550) chore(fuzz): AST fuzzer to use function valued arguments (Part 1) (noir-lang/noir#8514) fix(licm): Check whether the loop is executed when hoisting with a predicate (noir-lang/noir#8546) feat: Implement $crate (noir-lang/noir#8537) fix: add offset to ArrayGet (noir-lang/noir#8536) chore: remove some unused enum variants and functions (noir-lang/noir#8538) fix: disallow `()` in entry points (noir-lang/noir#8529) chore: Remove println in ssa interpreter (noir-lang/noir#8528) fix: don't overflow when casting signed value to u128 (noir-lang/noir#8526) chore(performance): Enable hoisting pure with predicate calls (noir-lang/noir#8522) feat(fuzz): AST fuzzing with SSA interpreter (noir-lang/noir#8436) chore: Add u1 ops to interpreter, convert Value panics to errors (noir-lang/noir#8469) chore: Release Noir(1.0.0-beta.6) (noir-lang/noir#8438) chore(fuzz): AST generator to add `ctx_limit` to all functions (noir-lang/noir#8507) fix(inlining): Use centralized CallGraph structure for inline info computation (noir-lang/noir#8489) fix: remove private builtins from `Field` impl (noir-lang/noir#8496) feat: primitive types are no longer keywords (noir-lang/noir#8470) fix: parenthesized pattern, and correct 1-element tuple printing (noir-lang/noir#8482) fix: fix visibility of methods in `std::meta` (noir-lang/noir#8497) fix: Change `can_be_main` to be recursive (noir-lang/noir#8501) chore: add SSA interpreter test for higher order functions (noir-lang/noir#8486) fix(frontend)!: Ban zero sized arrays and strings as program input (noir-lang/noir#8491) fix!: remove `to_be_radix` and `to_le_radix` from stdlib interface (noir-lang/noir#8495) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Description
Problem*
Summary*
Breaks out ssa interpreter changes from this PR: #8436
Additional Context
We apparently allow
u1 + u1in addition to other odd operations likeu1 << u1Documentation*
Check one:
PR Checklist*
cargo fmton default settings.