-Znext-solver Less normalizes-to janks#156619
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor changes to cc @lcnr This PR modifies |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
`-Znext-solver` Less normalizes-to janks
|
I haven't done the nested goals' recursion depth part yet 😅 I'm gonna work on it if the overall design here pan out to be feasible |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d4c528b): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.5%, secondary 8.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 26.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 510.626s -> 509.733s (-0.17%) |
|
Oh, the perf regressions are insane 😅 I'll look into them |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
`-Znext-solver` Less normalizes-to janks
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (52311d2): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.7%, secondary 8.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.3%, secondary 22.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 513.812s -> 509.975s (-0.75%) |
6bd6498 to
5927eca
Compare
This comment has been minimized.
This comment has been minimized.
|
If my observation is correct, this would fix the perf regression 🤔 |
| @@ -39,19 +34,12 @@ where | |||
| ty::AliasTermKind::ProjectionTy { .. } | ty::AliasTermKind::ProjectionConst { .. } => { | |||
| self.normalize_associated_term(goal) | |||
There was a problem hiding this comment.
and here you can keep this match as a debug_assert and just inline normalize_associated_term below it :3
This comment has been minimized.
This comment has been minimized.
We had never stepped into recursive replacement with `AliasRelate` goals when replacing aliases because `AliasRelate` goals don't allow normalization
8cdfcda to
54875bf
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=lcnr |
This comment has been minimized.
This comment has been minimized.
`-Znext-solver` Less normalizes-to janks cc rust-lang/trait-system-refactor-initiative#223 (comment) r? lcnr
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 812b7d1 failed: CI. Failed job:
|
|
The tail of that log shows nothing out of the ordinary, not even a spurious failure. @bors retry |
|
☔ The latest upstream changes (presumably #157794) made this pull request unmergeable. Please resolve the merge conflicts. This pull request was unapproved. |
| }; | ||
|
|
||
| self.instantiate_normalizes_to_term(goal, actual); | ||
| self.push_const_arg_has_type_goal(goal.param_env, goal.predicate.projection_term, actual); |
There was a problem hiding this comment.
Why are you adding that?
There was a problem hiding this comment.
ah hmm, it's interesting that we add const_arg_has_type here. I guess you're just inlining that function. cc @BoxyUwU why do we do it this way and not more specifically for free consts or sth like that?
There was a problem hiding this comment.
It has been introduced in #154853 to fix some ICEs
| goal.param_env, | ||
| goal.predicate.projection_term, | ||
| normalized, | ||
| ); |
There was a problem hiding this comment.
| self.inspect.make_canonical_response(Certainty::AMBIGUOUS); | ||
|
|
||
| // Apply the constraints. | ||
| self.try_evaluate_added_goals()?; |
There was a problem hiding this comment.
we don't add any nested goals here. This only handles the goals from replace_alias_with_infer. Move that below the make_canonical_response maybe?
There was a problem hiding this comment.
Yeah, the intention here is to normalize expected term. Without this, structural equating below may fail
View all comments
cc rust-lang/trait-system-refactor-initiative#223 (comment)
r? lcnr