Skip to content
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 Idents #92210

Closed
wants to merge 6 commits into from

Conversation

Aaron1011
Copy link
Member

Split out from #92204

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 22, 2021
@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 22, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 23, 2021
@cjgillot cjgillot self-assigned this Dec 23, 2021
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.
@rust-log-analyzer

This comment has been minimized.

@Aaron1011
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 24, 2021
@bors
Copy link
Contributor

bors commented Dec 24, 2021

⌛ Trying commit 7d18371 with merge 360798a02d08783253f065b05e6d2b0952dc3361...

@bors
Copy link
Contributor

bors commented Dec 24, 2021

💔 Test failed - checks-actions

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@Aaron1011
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 24, 2021

⌛ Trying commit 7d18371 with merge 1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78...

@bors
Copy link
Contributor

bors commented Dec 25, 2021

☀️ Try build successful - checks-actions
Build commit: 1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78 (1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78)

@rust-timer
Copy link
Collaborator

Queued 1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78 with parent aad4f10, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d91d882ec1873c87b78b0a1b8631fb4bf1f2d78): comparison url.

Summary: This change led to very large relevant regressions 😿 in compiler performance.

  • Very large regression in instruction counts (up to 452.6% on incr-patched: println builds of webrender)

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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 25, 2021
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 25, 2021
@Aaron1011
Copy link
Member Author

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.

@petrochenkov
Copy link
Contributor

Blocked on #92278.

@petrochenkov petrochenkov added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 26, 2021
@Aaron1011
Copy link
Member Author

Now that #92203 has been merged, let's see what the latest performance looks like:

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 2, 2022
@bors
Copy link
Contributor

bors commented Jan 2, 2022

⌛ Trying commit 7d18371 with merge fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2...

@bors
Copy link
Contributor

bors commented Jan 2, 2022

☀️ Try build successful - checks-actions
Build commit: fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2 (fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2)

@rust-timer
Copy link
Collaborator

Queued fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2 with parent 8f3238f, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fc922e0fe35a7aaa4bf5dbbe516ffd78dde591c2): comparison url.

Summary: This change led to very large relevant regressions 😿 in compiler performance.

  • Very large regression in instruction counts (up to 453.8% on incr-patched: println builds of webrender)

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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 3, 2022
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jan 3, 2022
@@ -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,
Copy link
Contributor

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.

Copy link
Member Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise.

@Aaron1011
Copy link
Member Author

I went with a better approach in #92533

@Aaron1011 Aaron1011 closed this Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants