Conversation
asterite
left a comment
There was a problem hiding this comment.
Nice!
I thought the solution could be memoizing but I didn't know if it was possible because types don't have IDs, though they do have equality and has so I guess it works.
It might be nice to add bench-show to see if there's any noticeable improvements in existing projects (just out of curiosity).
|
Um, I approved but I see there are some regressions, so maybe this broke something. In any case the changes look good. |
Yeah, quite large ones 😅. I'll look into those before merging. Not sure what they are currently. The main difference I can think of is that some |
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: d64f0a7 | Previous: d3cb2b2 | Ratio |
|---|---|---|---|
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob |
2 s |
1 s |
2 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_rollup-lib |
3 s |
1 s |
3 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types |
2 s |
1 s |
2 |
test_report_zkpassport_noir_rsa_ |
3 s |
2 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
This makes me think it is just because I didn't merge master originally. |
|
🚀 Deployed on https://6840a4eed48f9000b4ca2509--noir-docs.netlify.app |
| return None; | ||
| }; | ||
| let lhs = lhs.follow_bindings(); | ||
| let (l_type, l_op, l_rhs, _) = lhs.as_infix_expr()?; |
There was a problem hiding this comment.
Is it possible that recursing to find an InfixExpr here and/or in try_unify_by_moving_constant_terms ends up removing CheckedCast's?
There was a problem hiding this comment.
Yes - although without doing so we were failing in the arithmetic_generics test from failing to catch this case for results which were now cached to include CheckedCast where they previously dropped it
|
simplifying fn main() {
let x = (1, [2, 3, 4]);
assert_eq(x.serialize().len(), 4);
}We get the initial SSA If I change the tuple so that both elements are the same size, e.g. fn main() {
let x = ([1, 2, 3], [2, 3, 4]);
assert_eq(x.serialize().len(), 4);
}We now get the SSA It seems like we're not distinguishing between the associated constants on the various subtypes making up the tuple and instead are applying the |
|
FYI @noir-lang/developerrelations on Noir doc changes. |
Description
Problem*
Resolves #8545
Summary*
Optimizes
Type::canonicalizeby remembering the returned result which prevents this function from being quadratic in input size since we're no longer re-doing work. This also required a small fix to keep thearithmetic_genericstest working: we can't doif let Type::InfixExpr(..) = ...since that doesn't match onType::CheckedCastvariants which are meant to be transparent. With this fix that was previously causing canonicalize to leave some terms unsimplified.Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.