Conversation
Changes to number of Brillig opcodes executed
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
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: 0391662 | Previous: ab68576 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir-ecdsa_ |
3 s |
2 s |
1.50 |
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: 0391662 | Previous: ab68576 | Ratio |
|---|---|---|---|
rollup-checkpoint-merge |
0.004 s |
0.003 s |
1.33 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
compiler/noirc_evaluator/src/ssa/opt/remove_unreachable_instructions.rs
Outdated
Show resolved
Hide resolved
| b0(v0: u1): | ||
| enable_side_effects v0 | ||
| constrain u1 0 == v0, "attempt to divide by zero" | ||
| v3 = div u64 1, u64 1 |
There was a problem hiding this comment.
Hmm I still would expect this instruction to be removed.
There was a problem hiding this comment.
Me too. I was being lazy here. Now I re-checked this and it seems the logic is that instructions that have side effects are replaced with instructions with default values, while ones that don't have side effects are left as-is. But... I don't understand why. I don't know why instructions are never removed in this case.
There was a problem hiding this comment.
Ah, nevermind, instructions are removed, but only those that have side effects. Maybe it's because we under the effects of a predicate? But I still don't fully understand this.
There was a problem hiding this comment.
Yes it doesn't make sense to me that an instruction without side effects wouldn't be removed...
There was a problem hiding this comment.
This seems like it may even be a bug. I would expect instructions without side effects to just be removed.
There was a problem hiding this comment.
Let's just do #11009 (comment) to prevent these changes and we can determine why this is happening in follow-up work.
There was a problem hiding this comment.
We can probably wait for Akosh to come back, I think he did this part.
| // Check if this operation is one that should only fail if the predicate is enabled. | ||
| let requires_acir_gen_predicate = | ||
| binary.requires_acir_gen_predicate(context.dfg); | ||
| let requires_acir_gen_predicate = binary.has_side_effects(context.dfg); |
There was a problem hiding this comment.
Couldn't we still call requires_acir_gen_predicate here which calls has_side_effects internally? Do we maybe we need to override the Div/Mod cases in requires_acir_gen_predicate?
There was a problem hiding this comment.
Couldn't we still call requires_acir_gen_predicate here which calls has_side_effects internally?
No, because it's gone. Or should we keep requires_acir_gen_predicate as a synonym of has_side_effects for Binary?
There was a problem hiding this comment.
Or should we keep requires_acir_gen_predicate as a synonym of has_side_effects for Binary?
Yeah that is what I was thinking. And then before we call out to has_side_effects (inside of requires_acir_gen_predicate) we can special case Div/Mod to return true like they currently do. In a follow-up we can then address #11009 (comment) as it is starting to leave the scope of this PR.
…ctions.rs Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Changes to circuit sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 0391662 | Previous: ab68576 | Ratio |
|---|---|---|---|
rollup-checkpoint-merge |
0.002 s |
0.001 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Description
Problem
Resolves #10985
Summary
Additional Context
We could probably unify
requires_acir_gen_predicateandhas_side_effectsforBinary, but for now I decided to keep them slightly separate as there's a small difference.User Documentation
Check one:
PR Checklist
cargo fmton default settings.