fix(ssa): Validate field to integer cast#8799
Conversation
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: ec007e6 | Previous: 9d44ab7 | Ratio |
|---|---|---|---|
perfectly_parallel_batch_inversion_opcodes |
3573493 ns/iter (± 1553) |
2778522 ns/iter (± 7503) |
1.29 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Memory'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 1625b68 | Previous: 6f1b46f | Ratio |
|---|---|---|---|
private-kernel-inner |
292.98 MB |
202.09 MB |
1.45 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: c8a7b93 | Previous: 9580a12 | Ratio |
|---|---|---|---|
rollup-merge |
0.004 s |
0.003 s |
1.33 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
60a5bff to
e94a44f
Compare
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: c8a7b93 | Previous: 9580a12 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir_rsa_ |
2 s |
1 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
ACVM Benchmarks
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
purely_sequential_opcodes |
247842 ns/iter (± 520) |
254138 ns/iter (± 1529) |
0.98 |
perfectly_parallel_opcodes |
221797 ns/iter (± 2635) |
225984 ns/iter (± 1376) |
0.98 |
perfectly_parallel_batch_inversion_opcodes |
2784994 ns/iter (± 2173) |
2791262 ns/iter (± 10832) |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Execution Time
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
private-kernel-inner |
0.027 s |
0.027 s |
1 |
private-kernel-reset |
0.158 s |
0.155 s |
1.02 |
private-kernel-tail |
0.011 s |
0.011 s |
1 |
rollup-base-private |
0.29 s |
0.293 s |
0.99 |
rollup-base-public |
0.186 s |
0.191 s |
0.97 |
rollup-block-root |
10.8 s |
10.7 s |
1.01 |
rollup-merge |
0.004 s |
0.004 s |
1 |
rollup-root |
0.009 s |
0.009 s |
1 |
semaphore-depth-10 |
0.02 s |
0.02 s |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Artifact Size
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
private-kernel-inner |
1134.4 KB |
1134.4 KB |
1 |
private-kernel-reset |
2071.4 KB |
2071.4 KB |
1 |
private-kernel-tail |
588.5 KB |
588.5 KB |
1 |
rollup-base-private |
4944.6 KB |
4944.6 KB |
1 |
rollup-base-public |
3986.2 KB |
3986.2 KB |
1 |
rollup-block-root-empty |
240.3 KB |
240.3 KB |
1 |
rollup-block-root-single-tx |
25691.2 KB |
25691.2 KB |
1 |
rollup-block-root |
25717.7 KB |
25717.7 KB |
1 |
rollup-merge |
184.7 KB |
184.7 KB |
1 |
rollup-root |
420.8 KB |
420.8 KB |
1 |
semaphore-depth-10 |
636.4 KB |
636.4 KB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Compilation Time
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
private-kernel-inner |
2.386 s |
2.354 s |
1.01 |
private-kernel-reset |
7.364 s |
7.536 s |
0.98 |
private-kernel-tail |
1.09 s |
1.108 s |
0.98 |
rollup-base-private |
15.52 s |
16.14 s |
0.96 |
rollup-base-public |
12.98 s |
13.28 s |
0.98 |
rollup-block-root-empty |
1.194 s |
1.332 s |
0.90 |
rollup-block-root-single-tx |
124 s |
127 s |
0.98 |
rollup-block-root |
131 s |
127 s |
1.03 |
rollup-merge |
1.104 s |
1.094 s |
1.01 |
rollup-root |
1.652 s |
1.65 s |
1.00 |
semaphore-depth-10 |
0.794 s |
0.755 s |
1.05 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Test Suite Duration
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
test_report_AztecProtocol_aztec-packages_noir-projects_aztec-nr |
68 s |
70 s |
0.97 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-contracts |
109 s |
110 s |
0.99 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob |
43 s |
42 s |
1.02 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_private-kernel-lib |
210 s |
203 s |
1.03 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_rollup-lib |
263 s |
272 s |
0.97 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types |
70 s |
75 s |
0.93 |
test_report_noir-lang_noir-bignum_ |
421 s |
372 s |
1.13 |
test_report_noir-lang_noir_bigcurve_ |
244 s |
219 s |
1.11 |
test_report_noir-lang_sha512_ |
31 s |
28 s |
1.11 |
test_report_zkpassport_noir_rsa_ |
1 s |
1 s |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Compilation Memory
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
private-kernel-inner |
292.98 MB |
292.94 MB |
1.00 |
private-kernel-reset |
534.02 MB |
534.02 MB |
1 |
private-kernel-tail |
191.54 MB |
191.56 MB |
1.00 |
rollup-base-private |
1380 MB |
1380 MB |
1 |
rollup-base-public |
1510 MB |
1510 MB |
1 |
rollup-block-root-empty |
339.39 MB |
339.39 MB |
1 |
rollup-block-root-single-tx |
7830 MB |
7830 MB |
1 |
rollup-block-root |
7830 MB |
7830 MB |
1 |
rollup-merge |
327.16 MB |
327.17 MB |
1.00 |
rollup-root |
381.46 MB |
381.44 MB |
1.00 |
semaphore_depth_10 |
106.39 MB |
106.39 MB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Execution Memory
Details
| Benchmark suite | Current: bd45216 | Previous: 12bf0db | Ratio |
|---|---|---|---|
private-kernel-inner |
202.09 MB |
202.09 MB |
1 |
private-kernel-reset |
225.81 MB |
225.81 MB |
1 |
private-kernel-tail |
177.35 MB |
177.35 MB |
1 |
rollup-base-private |
489.89 MB |
489.89 MB |
1 |
rollup-base-public |
423.19 MB |
423.19 MB |
1 |
rollup-block-root |
1400 MB |
1400 MB |
1 |
rollup-merge |
312.02 MB |
312.02 MB |
1 |
rollup-root |
317.7 MB |
317.7 MB |
1 |
semaphore_depth_10 |
70.96 MB |
70.96 MB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
guipublic
left a comment
There was a problem hiding this comment.
I think the added truncates in remove_bit_shifts can be avoided.
I ultimately removed all of them @guipublic. I have moved to only running validation after initial SSA gen for the time being. It used to live in |
|
Could you also fix the wrong 'cast' in remove_bit_shits.rs? |
…ve_bit_shifts, and add field to integer cast tests in validation pass
I also ended up casting the overflow predicate to a Field so that the |
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: interpret all execution_success programs (noir-lang/noir#8887) fix: always error if integer literal doesn't fit its type on the fron… (noir-lang/noir#8885) fix: Count array copies for slice functions (noir-lang/noir#8867) chore(ssa): Simplify truncate when the bit size we are truncating to is greater than the value's max bit size (noir-lang/noir#8875) fix(ssa): Validate field to integer cast (noir-lang/noir#8799) feat: SSA interpreter checks return value (noir-lang/noir#8883) chore: add return value to every execution_success program that produces an output (noir-lang/noir#8882) chore(fuzz): Run fuzzing deterministically on CI (noir-lang/noir#8868) fix: (SSA interpreter) check requires_acir_gen_predicate for enable_side_effects (noir-lang/noir#8869) feat: allow printing each SSA interpreter definition (noir-lang/noir#8865) fix: handle unconditional break during SSA codegen in all cases (noir-lang/noir#8855) fix: update external lib commit tdd.nr (noir-lang/noir#8823) chore: bump dependencies (noir-lang/noir#8838) chore(fuzz): Enable SSA Interpreter fuzzing on all passes (noir-lang/noir#8610) chore: Prune changelog older than ~1 year (<0.32.0) (noir-lang/noir#8856) chore(docs): Add links to awesome-noir in sidebar (noir-lang/noir#8854) chore: add a regression test for #8727 (noir-lang/noir#8851) chore(fuzz): Handle overflows in comptime fuzzing (noir-lang/noir#8847) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: interpret all execution_success programs (noir-lang/noir#8887) fix: always error if integer literal doesn't fit its type on the fron… (noir-lang/noir#8885) fix: Count array copies for slice functions (noir-lang/noir#8867) chore(ssa): Simplify truncate when the bit size we are truncating to is greater than the value's max bit size (noir-lang/noir#8875) fix(ssa): Validate field to integer cast (noir-lang/noir#8799) feat: SSA interpreter checks return value (noir-lang/noir#8883) chore: add return value to every execution_success program that produces an output (noir-lang/noir#8882) chore(fuzz): Run fuzzing deterministically on CI (noir-lang/noir#8868) fix: (SSA interpreter) check requires_acir_gen_predicate for enable_side_effects (noir-lang/noir#8869) feat: allow printing each SSA interpreter definition (noir-lang/noir#8865) fix: handle unconditional break during SSA codegen in all cases (noir-lang/noir#8855) fix: update external lib commit tdd.nr (noir-lang/noir#8823) chore: bump dependencies (noir-lang/noir#8838) chore(fuzz): Enable SSA Interpreter fuzzing on all passes (noir-lang/noir#8610) chore: Prune changelog older than ~1 year (<0.32.0) (noir-lang/noir#8856) chore(docs): Add links to awesome-noir in sidebar (noir-lang/noir#8854) chore: add a regression test for #8727 (noir-lang/noir#8851) chore(fuzz): Handle overflows in comptime fuzzing (noir-lang/noir#8847) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: interpret all execution_success programs (noir-lang/noir#8887) fix: always error if integer literal doesn't fit its type on the fron… (noir-lang/noir#8885) fix: Count array copies for slice functions (noir-lang/noir#8867) chore(ssa): Simplify truncate when the bit size we are truncating to is greater than the value's max bit size (noir-lang/noir#8875) fix(ssa): Validate field to integer cast (noir-lang/noir#8799) feat: SSA interpreter checks return value (noir-lang/noir#8883) chore: add return value to every execution_success program that produces an output (noir-lang/noir#8882) chore(fuzz): Run fuzzing deterministically on CI (noir-lang/noir#8868) fix: (SSA interpreter) check requires_acir_gen_predicate for enable_side_effects (noir-lang/noir#8869) feat: allow printing each SSA interpreter definition (noir-lang/noir#8865) fix: handle unconditional break during SSA codegen in all cases (noir-lang/noir#8855) fix: update external lib commit tdd.nr (noir-lang/noir#8823) chore: bump dependencies (noir-lang/noir#8838) chore(fuzz): Enable SSA Interpreter fuzzing on all passes (noir-lang/noir#8610) chore: Prune changelog older than ~1 year (<0.32.0) (noir-lang/noir#8856) chore(docs): Add links to awesome-noir in sidebar (noir-lang/noir#8854) chore: add a regression test for AztecProtocol#8727 (noir-lang/noir#8851) chore(fuzz): Handle overflows in comptime fuzzing (noir-lang/noir#8847) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
Description
Problem*
Resolves #8087
Builds upon #8798 as I was originally worried about merge conflicts for building off of #8765.
Summary*
This simply adds validation for Field -> integer casting. Casting involving signed integer requires a much more involved validation check.
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.