-
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
Remove allow(rustc::potential_query_instability) in rustc_const_eval #102674
Conversation
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. Please see the contribution instructions for more information. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 5791045a2f49613b4135a01099b7b9b465a72d4e with merge 7c0a7d4c564592173aaa1dd1dca36b9126a0f51c... |
☀️ Try build successful - checks-actions |
Queued 7c0a7d4c564592173aaa1dd1dca36b9126a0f51c with parent d8613f7, future comparison URL. |
I guess we need an IndexMap because we iterate over this for interning? |
Finished benchmarking commit (7c0a7d4c564592173aaa1dd1dca36b9126a0f51c): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never 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.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
Yes, from what I understand it is to make compilations reproducible as @/Aaron1011 explained:
If we are sure that iterating over the I also don't know if that regression is acceptable or not. 0.5% seems to be significant. |
It doesn't cause problems here, because all we do is insert |
Then I suppose it's better now. Is the explanation enough? I would like to do it better, but I'm afraid I don't know enough about rustc_const_eval to do it. |
That's pretty subtle though. We only have regression in secondary benchmarks (stress tests), nothing primary, so this might be fine in exchange for definitely not having subtle query bugs. Up to you though, I don't understand the query stuff that well anyway.^^ |
I's been a week, so I will try to sum everything up. There are two options:
|
An 0.5% regression in secondary benchmarks only, to be specific: tuple-stress and coercions. |
@@ -131,6 +131,9 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxHashMap<K, V> { | |||
|
|||
#[inline(always)] | |||
fn filter_map_collect<T>(&self, mut f: impl FnMut(&K, &V) -> Option<T>) -> Vec<T> { |
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 site depends on the callers, but the only caller is the leak checker. So we could either make the function name end with like _only_use_in_miri
or just fix it and let miri take the perf hit
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 think the perf hit should be tiny for the usual case where programs have freed most of their memory when they terminate.
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.
But there's another perf hit somewhere, right? After all we are seeing a regression in the benchmarks.
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.
Yes, in the interner, that one is unavoidable.
Agreed, I'd still want to figure out a way to get the best of both worlds: guaranteed correctness and performance. But that doesn't have to happen here. So let's take the perf hit, basically changing everything back to your original PR. Sorry about the back and forth |
The use of FxHashMap has been replaced with FxIndexMap. For more information see rust-lang#84447
Don't worry about it! I already brought back the initial changes and also rebased the fork. |
@bors r+ rollup=never |
Sorry, but I was working on #103218 and I noticed I made a mistake in this PR. The reproducibility guarantees that |
@bors r- |
Oof, that's subtle, but makes sense. I'm really not sure on the best way to fix this beyond moving to a more salsa like scheme. |
So the lint is not able to capture that?
This needs careful documentation...
|
yea, I think we should rename |
Okay, it seems I was wrong. Calling Sorry for the back and forth 😥 I should have checked this before. This PR is okay as it is and I'll remove the |
Hmm... that's only true if the order of items we remove is reliable. I guess that's the case here, but very very subtle |
Yes, but in that case the reproducibility problem would come from another source, which is the one that should get fixed. The compilation sessions should be totally reproducible, which is why we are doing this. I'm inclined to think that probably it won't be an issue, but I could be wrong. I guess it could produce confusion on the origin of a bug, though. Should I change #103218 ? Maybe that merge should be stopped, until we are sure on how to proceed. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5237c4d): comparison URL. Overall result: ❌✅ regressions and improvements - 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 |
The keccak, wg-grammar, and cranelift-codegen results here are noise. The other changes (mostly tuple-stress, coercions, ucd) are real, but they were deemed acceptable above. @rustbot label: +perf-regression-triaged |
Remove allow(rustc::potential_query_instability) in rustc_const_eval The use of FxHashMap has been replaced with FxIndexMap. Related to rust-lang#84447
The use of FxHashMap has been replaced with FxIndexMap.
Related to #84447