Add rigid alias marker#156742
Conversation
|
Unfinished. Let's have a look at the perf impact nonetheless. @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.
[Experiment] Add rigid alias marker
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 73eccb5 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
@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.
[Experiment] Add rigid alias marker
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (42e2939): comparison URL. Overall result: ❌ regressions - 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.6%, secondary -1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%, secondary 17.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 510.83s -> 514.725s (0.76%) |
|
@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.
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 47c3197 failed: CI. Failed job:
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for c18f80f failed: CI. Failed job:
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 973ad0d (parent) -> fa36a47 (this PR) Test differencesShow 108 test diffsStage 1
Stage 2
Additionally, 102 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fa36a479e492137fdf473a891206da127f132910 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (fa36a47): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression 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.9%, secondary -1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.3%, secondary -2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 509.16s -> 506.998s (-0.42%) |
|
necessary refactor for the new trait solver and I would just eat the 1.4% diesel regression. THe next solver regressions don't matter |
View all comments
This PR adds a rigidness marker to
TyKind::AliasandConstKind::Unevaluated. It's used to skip renormalization of rigid aliases. The tracking issue for this is #155345.The difficulty is that rigid aliases are only valid in their own
TypingEnvso we need to force them back to non-rigid when entering anotherTypingEnv, either because a change to theParamEnvor because we enter anotherTypingMode.Changes to the
ParamEnvcurrently only happen by moving into a new context. We now make sure thatEarlyBindernew contains any rigid aliases, this way we have to normalize all aliases contained in it after instantiating.Changes to the
TypingModeare rare, and have to be manually handled.The main changes in this PR are as follows:
enum IsRigid { Yes, No }as a field toTyKind::AliasandConstKind::Unevaluated. It is alwaysNowith the old solver, this makes some of the code less nice than it will be with the old solver removed.Projectiongoals we equate the expected term with that alias withIsRigid::YesEarlyBinder::bindnow takes thetcxand eagerly sets allIsRigidtoNo, this is necessary as moving aliases into a differentTypingEnvmay cause them to no longer be rigidEarlyBinder::bind_iterasserts that there are no rigid aliases instead of replacing themTyKind::AliaswithIsRigid::NoThere's a lot of future work here:
AliasRelate, lazily replace non-rigid aliases with infer var + projection goalParamEnvnormalization hack to incorrectly mark things as rigidTypeOutlivesgoal handling to only expect rigid aliasesIsRigid::Yesin region handling (oryes_if_next_solver)EarlyBinder::bindto also assert that there are no rigid aliases and manually replacing rigid aliases before then where necessaryThis PR also adds a flag
-Zrenormalize-rigid-aliasesto test whether we properly handle typing mode change.Currently only
tests/ui/traits/next-solver/assembly/ambiguity-due-to-uniquification-4.rsfails this check.r? lcnr