-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
resolve: More detailed effective visibility tracking for imports #103965
Conversation
r? @eholk (rustbot has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 07d11859ca3422305170e8d0a8dcf2ca5fc0611c with merge 84523e4ff143a1157bc045ff4ed6fc8db7a7b613... |
cc @Bryanskiy |
☀️ Try build successful - checks-actions |
Queued 84523e4ff143a1157bc045ff4ed6fc8db7a7b613 with parent 2efb0cd, future comparison URL. |
Finished benchmarking commit (84523e4ff143a1157bc045ff4ed6fc8db7a7b613): comparison URL. Overall result: ❌✅ regressions and improvements - 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.
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.
|
Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.
07d1185
to
5aa6713
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 5aa6713a19b977eac837e38df05b5b6d45947e2c with merge e2d6dc9c235b9caee330ac7d87f1db59c17a2a92... |
… pass This should result in less update calls than doing it repeatedly during the fix point iteration.
Logic lgtm and makes sense. Last time it did, too, so let's ask crater at least @craterbot check r=me with crater not finding anything |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
None of the "regressions" seem remotely related and I don't know how this PR could cause
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c5842b0): 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.
|
This is an internal refactoring that we need to get more precise tracking of imports in presence of globs. So I am going to treat the regressions as acceptable and mark it as triaged. @rustbot label: +perf-regression-triaged |
privacy: Fix more (potential) issues with effective visibilities Continuation of rust-lang#103965. See individual commits for more detailed description of the changes. The shortcuts removed in rust-lang@4eb63f6 and rust-lang@c7c7d16 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually". I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports. After this PR all table changes should be "locally correct" after every update, even if it may be overcautious. If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs. Fixes rust-lang#104249. Fixes rust-lang#104539.
privacy: Fix more (potential) issues with effective visibilities Continuation of rust-lang/rust#103965. See individual commits for more detailed description of the changes. The shortcuts removed in rust-lang/rust@4eb63f6 and rust-lang/rust@c7c7d16 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually". I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports. After this PR all table changes should be "locally correct" after every update, even if it may be overcautious. If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs. Fixes rust-lang/rust#104249. Fixes rust-lang/rust#104539.
privacy: Fix more (potential) issues with effective visibilities Continuation of rust-lang/rust#103965. See individual commits for more detailed description of the changes. The shortcuts removed in rust-lang/rust@4eb63f6 and rust-lang/rust@c7c7d16 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually". I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports. After this PR all table changes should be "locally correct" after every update, even if it may be overcautious. If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs. Fixes rust-lang/rust#104249. Fixes rust-lang/rust#104539.
Per-
DefId
tracking is not enough, due to glob imports in particular, which have a singleDefId
for the whole glob import item.We need to track this stuff per every introduced name (
NameBinding
).Also drop
extern
blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.Later commits add some debug-only invariant checking and optimiaztions to mitigate regressions in #103965 (comment).
This is a bugfix and continuation of #102026.