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

Remove NodeIdHashingMode. #95656

Merged
merged 2 commits into from
Apr 13, 2022
Merged

Remove NodeIdHashingMode. #95656

merged 2 commits into from
Apr 13, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Apr 4, 2022

r? @ghost

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 4, 2022
@cjgillot
Copy link
Contributor Author

cjgillot commented Apr 4, 2022

@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 Apr 4, 2022
@bors
Copy link
Contributor

bors commented Apr 4, 2022

⌛ Trying commit a76ccee8dd1a7d0d5ab2cfbae99e67e8113e51b3 with merge dcf75be0c15ea1a13be81f9df9ed7d549507a771...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Apr 4, 2022

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

@rust-timer
Copy link
Collaborator

Queued dcf75be0c15ea1a13be81f9df9ed7d549507a771 with parent 6a9080b, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dcf75be0c15ea1a13be81f9df9ed7d549507a771): comparison url.

Summary:

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 114 89 0 0 114
mean2 0.6% 0.7% N/A N/A 0.6%
max 1.2% 4.2% N/A N/A 1.2%

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

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@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 Apr 4, 2022
@cjgillot
Copy link
Contributor Author

r? @Aaron1011
This should fix #95945.
I'm about to bless incremental tests.

@Aaron1011
Copy link
Member

I would love to be able to get rid of all of these manual impls, as well as a configuration knob. I assume that NodeIdHashingMode was just an optimizarion (less time spent hashing and fewer incr comp in validations). Cc @rust-lang/wg-incr-comp - is there anything that might be relying on these things not being hashed (analogous to how symbol hashing relies on being able to skip span hashing).

@michaelwoerister
Copy link
Member

As far as I remember, this was intended as an optimization to avoid redundant hashing, yes. I love how big of a simplification this is!

How does it fix #95945?

@Aaron1011
Copy link
Member

@michaelwoerister That bug is caused by some of the manual impls hashing ident.name, instead of hashing ident (which includes the Span). All of the manual impls with that bug should be replaced by derives in this PR.

@cjgillot
Copy link
Contributor Author

The PR removes the manual HashStable impl that Aaron suspects causes the bug. I don't have tested it yet.

@Aaron1011
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 13, 2022

📌 Commit 0927a35 has been approved by Aaron1011

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2022
root_body.hash_stable(hcx, hasher)
});

root_body.hash_stable(hcx, hasher);
Copy link
Member

Choose a reason for hiding this comment

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

I think this manual impl could be replaced by a derive entirely, right?

map.hash_stable(hcx, hasher);
});
let AccessLevels { ref map } = *self;
map.hash_stable(hcx, hasher);
Copy link
Member

Choose a reason for hiding this comment

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

I think this manual impl could be replaced by a derive entirely, right?

@lqd
Copy link
Member

lqd commented Apr 13, 2022

I've tested the latest try build here (dcf75be0c15ea1a13be81f9df9ed7d549507a771) and it did fix the incremental ICE from #95945. It would be good to have a test for it, but that issue doesn't have an MCVE as of yet.

@michaelwoerister
Copy link
Member

This PR is expected to cause a small but noticeable performance regression. This is unfortunate, but it the PR is one step towards removing footguns from the incr. comp. system, so I'm going to mark it as triaged: @rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 13, 2022
@bors
Copy link
Contributor

bors commented Apr 13, 2022

⌛ Testing commit 0927a35 with merge f38c5c8...

@bors
Copy link
Contributor

bors commented Apr 13, 2022

☀️ Test successful - checks-actions
Approved by: Aaron1011
Pushing f38c5c8 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f38c5c8): comparison url.

Summary:

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 103 75 0 8 103
mean2 0.6% 0.7% N/A -0.5% 0.6%
max 1.1% 1.7% N/A -0.8% 1.1%

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-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@cjgillot cjgillot deleted the no-id-hashing-mode branch April 13, 2022 17:20
@wesleywiser
Copy link
Member

Nominating for beta-backport since this fixes a reported incremental compilation ICE.

@wesleywiser wesleywiser added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 14, 2022
@apiraino
Copy link
Contributor

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 21, 2022
@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 24, 2022
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.62.0, 1.61.0 Apr 24, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2022
…ulacrum

[beta] backports rollup

*  Remove NodeIdHashingMode. rust-lang#95656
*  Check that all hidden types are the same and then deduplicate them. rust-lang#95731

r? `@Mark-Simulacrum`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

None yet