-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Enforce that query results implement Debug #80692
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit 6294e9c904fa3c14aa1935385037f58ec8ec7793 with merge 3bf0928529d2653a392113783e402c573c81c8a8... |
☀️ Try build successful - checks-actions |
Queued 3bf0928529d2653a392113783e402c573c81c8a8 with parent 6163bfd, future comparison URL. @rustbot label: +S-waiting-on-perf |
Finished benchmarking try commit (3bf0928529d2653a392113783e402c573c81c8a8): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
The debug formatting of the value should only run when the assertion fails, which is never. I have no idea how adding a bunch of |
Putting the bound on |
Changes in rustc_query_system tend to have an absurdly high impact, but those perf results take it to a whole new level. |
I love how the regressions are all for incremental runs with no code changes (except externs-debug where it affects only full runs). 🙃 |
I'm unopposed to the change itself, but share the concern of compiling rustc timing after the change. |
If it's CGU partitioning, which seems plausible, you might rebase and see if you're luckier the next time around. |
Let's see if things are any different with the latest master: @bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit 6294e9c904fa3c14aa1935385037f58ec8ec7793 with merge 3e5e3a74a65f250eef3d36243bbcdf15bcbc454a... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@@ -15,7 +15,7 @@ pub trait CacheSelector<K, V> { | |||
} | |||
|
|||
pub trait QueryStorage: Default { | |||
type Value; | |||
type Value: Debug; |
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.
Are bounds in this file necessary? Putting them on QueryConfig::Value
should be enough.
Finished benchmarking try commit (c23f8d7d27456bf28becd5d64f41bcab2259a949): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
@bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit 056fbbf with merge 5fae81261f5ea323985073465c301d8fa35e7d93... |
#79100 (comment) showed that the cold path of an |
☀️ Try build successful - checks-actions |
Queued 5fae81261f5ea323985073465c301d8fa35e7d93 with parent 2e46cb3, future comparison URL. @rustbot label: +S-waiting-on-perf |
Finished benchmarking try commit (5fae81261f5ea323985073465c301d8fa35e7d93): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
There's still some perf changes, but they're much smaller, and hopefully just noise. |
@bors r+ |
📌 Commit 056fbbf has been approved by |
☀️ Test successful - checks-actions |
Debug-print result when an unstable fingerprint is detected Helps with issues like rust-lang#83311 I had previously tried to do this in rust-lang#80692, but it had a significant performance impact (even though the code was never actually run). Hopefully, this will be better now that rust-lang#79100 has been merged.
Currently, we require that query keys implement
Debug
, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk.This PR adds
Debug
bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding#[derive(Debug)]
to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.