-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 🤔 |
This comment has been minimized.
This comment has been minimized.
|
@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
This comment has been minimized.
This comment has been minimized.
|
💔 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 |
This comment has been minimized.
This comment has been minimized.
| }; | ||
|
|
||
| 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.
Yeah, I'm inlining it. 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, but my intention here is solving those very goals from replace_alias_with_infer, to normalize the expected term. If we don't do this before structurally equating normalized term and the expected term below, it may fail if the expected term isn't rigid but can be normalized further.
I guess this would be unnecessary due to eager normalization or rigidness marker likewise replacing aliases with infer above but I'm doing it to avoid regressing some tests 😅
We had never stepped into recursive replacement with `AliasRelate` goals when replacing aliases because `AliasRelate` goals don't allow normalization
54875bf to
52b733c
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. |
|
☔ The latest upstream changes (presumably #157852) made this pull request unmergeable. Please resolve the merge conflicts. |
|
|
||
| let ct = ct.super_fold_with(self); | ||
| let ty::ConstKind::Unevaluated(..) = ct.kind() else { return ct }; | ||
| let ty::ConstKind::Unevaluated(uc) = ct.kind() else { return ct }; |
There was a problem hiding this comment.
silly nit that's not important to fix for this PR, just for the future - I think we typically call UnevaluatedConst variables uv instead of uc. But, we're renaming UnevaluatedConst to AliasConst soon, so perhaps a moot point.
this PR is super cool though! learned a lot reading through it, especially the comments you added in project_goals/mod.rs, heck yeah
(sorry for the merge conflict due to my AliasTerm::def_id PR that just merged :c )
View all comments
cc rust-lang/trait-system-refactor-initiative#223 (comment)
r? lcnr