-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Implement version of normalize_erasing_regions that allows for normalization failure #91255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 11f105cd6e9635ae233a61121bdf330f1b040582 with merge 7cd727ea460dd27fc8f52e430e9cd2301eec1439... |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even care about the size of this type? We care about InterpErrorInfo
but that is a Box
so it is independent of the size of InterpError
.
So I think I would favor removing this assertion, it might just lead someone to unnecessarily introduce another unnecessary Box
indirection.
This is great :) does this fix the test in #82039? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just make these two "normalizing {}
", so the error outputs are nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is never actually emitted? Makes me wonder if we actually need to keep track of what we couldn't normalize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I noticed that too and was debating whether we need the type, but think that it makes sense to output the type for which normalization fails here. There are a couple other issues which triggered this ICE (but not through layout_of
and which have yet to be fixed (although I think the new function would make that fairly straightforward)), and we might need this type information there.
I also added another test for issue 85103 which emits this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this deserves a comment on why failing to fully normalize is valid here. I would potentially imagine that by the time we need to know layout, we should have all the information to normalize (though I'm not sure, this might not be true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might make sense to have two different versions of layout_of
. Currently most of the calls of that function happen after typecheck and normalization is always guaranteed to succeed, but there are some calls in typecheck and some lints that use it. Does it makes sense to have one version which requires normalization to succeed and another in which it can fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good question! In #82039, IIRC we were basically coming to the conclusion that we shouldn't be trying to get the layout of things until after typechecking. So, I think splitting out layout_of
into two version is a decent intermediate step to "audit", in some way, incorrect behavior.
I think this would be better as a followup. Can you add a FIXME or file an issue?
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
You'll need to update rustdoc:
|
@jackh726 The test in #82039 is not fixed by this, since I only used @camelid The two issues you mentioned are fixed by this PR, added tests. |
Can anybody request another another timer run once CI passes, please? |
This comment has been minimized.
This comment has been minimized.
b5bdb1c
to
ce0e6f8
Compare
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ce0e6f8c86311589ecc6df277b37bbe236e0e8ca with merge 3393f73e33f01001d1dbe2362ae0d7311dba2447... |
26f60f2
to
6952470
Compare
@bors r=jackh276 |
📌 Commit 6952470 has been approved by |
☀️ Test successful - checks-actions |
Ooh, I wonder if this could be used for #82692 :) |
Finished benchmarking commit (f04a2f4): comparison url. Summary: This change led to small relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
@b-naber @jackh726 as you can see this PR yielded some performance regressions (albeit not huge ones and mostly in stress tests. Looking at the self profiling info, nothing jumped out at me. A run of cachegrind may be in order, but I unfortunately don't have time to do that right now. Any thoughts on potential causes of the regressions? |
@rylev performance regression might be due to the fact that we don't cache |
Fixes #59324
Fixes #67684
Fixes #69398
Fixes #71113
Fixes #82079
Fixes #85103
Fixes #88856
Fixes #91231
Fixes #91234
Previously we called
normalize_erasing_regions
insidelayout_of
.normalize_erasing_regions
assumes that the normalization succeeds. Since somelayout_of
calls happen before typecheck has finished, we introduce a new variant that allows for returning an error.