-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[WIP] Stop ignoring Span
field when hashing some Ident
s
#92210
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This causes us to miss legitimate evaluatiosn (e.g. an upstream `ExpnId` no longer exists), leading to ICEs when decoding stale values from the incremental cache.
e11ef37
to
b50fd63
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 7d18371 with merge 360798a02d08783253f065b05e6d2b0952dc3361... |
💔 Test failed - checks-actions |
@bors try |
⌛ Trying commit 7d18371 with merge 1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78... |
☀️ Try build successful - checks-actions |
Queued 1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78 with parent aad4f10, future comparison URL. |
Finished benchmarking commit (1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
This is now finished, but has awful performance, and a separate fix for a caching issue. I've split out #92278 to fix the caching issue. Since this PR will fix nightly incremental ICEs that several users have been reporting, we might want to merge this soon, and then work on winning back the performance lost by increased query invalidation. |
Blocked on #92278. |
Now that #92203 has been merged, let's see what the latest performance looks like: @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 7d18371 with merge fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2... |
☀️ Try build successful - checks-actions |
Queued fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2 with parent 8f3238f, future comparison URL. |
Finished benchmarking commit (fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
@@ -43,7 +43,6 @@ impl AssocItemContainer { | |||
#[derive(Copy, Clone, Debug, PartialEq, HashStable, Eq, Hash)] | |||
pub struct AssocItem { | |||
pub def_id: DefId, | |||
#[stable_hasher(project(name))] | |||
pub ident: Ident, |
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.
IIRC, this field is used for name resolution. So it really only needs the Symbol
and the SyntaxContext
. In case of diagnostics, the span can be recovered with the def_ident_span
query.
Should we introduce a struct HygienicIdent { name: Symbol, ctxt: SyntaxContext }
for this purpose? This could avoid part of the regression due to moved code.
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 came to the same conclusion about the Span
. I'm working on a branch locally where I've switched to just storing a Symbol
, and using def_ident_span
to reconstruct the Ident
in the few cases where it's actually needed.
@@ -1502,7 +1502,6 @@ pub struct VariantDef { | |||
/// If this variant is a struct variant, then this is `None`. | |||
pub ctor_def_id: Option<DefId>, | |||
/// Variant or struct name. | |||
#[stable_hasher(project(name))] | |||
pub ident: Ident, |
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.
Likewise.
I went with a better approach in #92533 |
Split out from #92204