-
Notifications
You must be signed in to change notification settings - Fork 13k
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
add depth_limit
in QueryVTable
to avoid entering a new tcx in layout_of
#100748
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This is a great idea! |
⌛ Trying commit d5fe7e466475a917137acb172c22e87e1f212a7e with merge d13747083b5d00d7431b366d24a965382115107f... |
☀️ Try build successful - checks-actions |
@rust-timer build d13747083b5d00d7431b366d24a965382115107f |
Queued d13747083b5d00d7431b366d24a965382115107f with parent e1b28cd, future comparison URL. |
Finished benchmarking commit (d13747083b5d00d7431b366d24a965382115107f): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
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 may lead to changes in compiler perf. @bors rollup=never Footnotes |
A single benchmark has a minor regression. |
📌 Commit d5fe7e466475a917137acb172c22e87e1f212a7e has been approved by It is now in the queue for this repository. |
Thanks for reviewing! |
⌛ Testing commit d5fe7e466475a917137acb172c22e87e1f212a7e with merge 125eb92bed75ab95ad00039ed2c3809fd73449b3... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
d5fe7e4
to
5b695e7
Compare
Rebased on top of #100723 to fix the build failure |
diagnostics: Option<&Lock<ThinVec<Diagnostic>>>, | ||
compute: impl FnOnce() -> R, | ||
) -> R { | ||
// The `TyCtxt` stored in TLS has the same global interner lifetime | ||
// as `self`, so we use `with_related_context` to relate the 'tcx lifetimes | ||
// when accessing the `ImplicitCtxt`. | ||
tls::with_related_context(**self, move |current_icx| { | ||
if depth_limit && !self.recursion_limit().value_within_limit(current_icx.query_depth) { | ||
panic!("queries overflow the depth limit!"); |
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 used to be a fatal error message. Could you make it so?
Panics are considered ICEs, and ask for a bug report. This is not the case.
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.
Yea, I added depth_limit_error
func in QueryContext
so we can keep #![deny(rustc::diagnostic_outside_of_impl)]
in rustc_query_impl
5b695e7
to
44c2f1e
Compare
☔ The latest upstream changes (presumably #100920) made this pull request unmergeable. Please resolve the merge conflicts. |
44c2f1e
to
cbc6bd2
Compare
rebased again |
@bors r+ |
This currently has |
⌛ Testing commit cbc6bd2 with merge ae14a41981cd265662b36257f1067b7fe664fa57... |
💥 Test timed out |
There seems to be something wrong with CI itself. Can it try again? |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (cfb5ae2): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Most of the regressions are happening in However, there are some regressions that seem like they might be real, and they are all in The cachegrind diff doesn't show anythign immeadiately obvious:
@SparrowLii @cjgillot @nnethercote any ideas or shall we just accept this small hit to docs? |
The |
Fixes #49735
Updates #48685
The
layout_of
query needs to check whether it overflows the depth limit, and the current implementation needs to create a newImplicitCtxt
insidelayout_of
. However,start_query
will already create a newImplicitCtxt
, so we can check the depth limit instart_query
.We can tell whether we need to check the depth limit simply by whether the return value of
to_debug_str
of the query islayout_of
. But I think adding thedepth_limit
field inQueryVTable
may be more elegant and more scalable.