-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Extend SCC construction to enable extra functionality #125069
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
Conversation
r? Lqd |
@bors try @rust-timer queue As discussed on zulip, until I have more time let's also temporarily redirect to niko for review or reassignment, and discuss at this week's meeting: r? nikomatsakis |
This comment has been minimized.
This comment has been minimized.
Extend SCC construction to enable extra functionality Do YOU feel like your SCC construction doesn't do enough? Then I have a patch for you! SCCs can now do *everything*! Well, almost. This patch has been extracted from rust-lang#123720. It specifically enhances `Sccs` to allow tracking arbitrary commutative properties (think min/max mappings on nodes vs arbitrary closures) of strongly connected components, including - reachable values (max/min) - SCC-internal values (max/min) This helps with among other things universe computation. We can now identify SCC universes as a reasonably straightforward "find max/min" operation during SCC construction. This is also included in this patch. It's also more or less zero-cost; don't use the new features, don't pay for them. This commit also vastly extends the documentation of the SCCs module, which I had a very hard time following. It may or may not have gotten easier to read for someone else. I believe this logic can also be used in leak check, but haven't checked. Ha. ha. Ha.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6c7f0a6): 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.
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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.291s -> 676.941s (0.24%) |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Extend SCC construction to enable extra functionality Do YOU feel like your SCC construction doesn't do enough? Then I have a patch for you! SCCs can now do *everything*! Well, almost. This patch has been extracted from rust-lang#123720. It specifically enhances `Sccs` to allow tracking arbitrary commutative properties (think min/max mappings on nodes vs arbitrary closures) of strongly connected components, including - reachable values (max/min) - SCC-internal values (max/min) This helps with among other things universe computation. We can now identify SCC universes as a reasonably straightforward "find max/min" operation during SCC construction. This is also included in this patch. It's also more or less zero-cost; don't use the new features, don't pay for them. This commit also vastly extends the documentation of the SCCs module, which I had a very hard time following. It may or may not have gotten easier to read for someone else. I believe this logic can also be used in leak check, but haven't checked. Ha. ha. Ha.
My guess is 0.3% primary regressions and 0.84% in secondary, let's see how wrong I am! Also, you can't edit on GitHub so there is no way for me to remove this if I'm enormously off. Too bad! |
@rust-timer build 1805d8a |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (1805d8a): 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)Results (primary -0.4%)This 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.
CyclesResults (primary -0.2%, secondary -1.0%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 669.422s -> 671.224s (0.27%) |
2be0958
to
e1204fe
Compare
Note that this changes no executing code. The change is 100% in documentation.
This version shaves off ca 2% of the cycles in my experiments and makes the control flow easier to follow for me and hopefully others, including the compiler. Someone gave me a working profiler and by God I'm using it.
This shaves off ca 6% of the cycles in `start_walk_from()` in my experiments.
Apparently this interferes with inlining and murders performance on `wg-grammar`.
This commit addresses @lqd's code review and resurrects a lost comment and removes some dead code.
In terms of code organisation, this is a lot cleaner and allows tighter access modifiers.
e754d68
to
d63708b
Compare
Rebased! |
@bors r=nikomatsakis |
☀️ Test successful - checks-actions |
Finished benchmarking commit (8cf5101): 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)Results (primary -3.2%, secondary -5.0%)This 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.
CyclesResults (secondary -1.8%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.52s -> 672.648s (0.17%) |
This version is a squash-rebased version of a series of exiermental commits, since large parts of them were broken out into PR rust-lang#125069. It explicitly handles universe violations in higher-kinded outlives constraints by adding extra outlives static constraints.
@amandasystems @nikomatsakis I see that the perf regressions were brought down since the first perf run, but there's still instruction count regressions in primary benchmarks here (albeit not large ones). Shall we just mark this as triaged and move on? |
That’s how I understood the decision anyway! |
This version is a squash-rebased version of a series of exiermental commits, since large parts of them were broken out into PR rust-lang#125069. It explicitly handles universe violations in higher-kinded outlives constraints by adding extra outlives static constraints.
This version is a squash-rebased version of a series of exiermental commits, since large parts of them were broken out into PR rust-lang#125069. It explicitly handles universe violations in higher-kinded outlives constraints by adding extra outlives static constraints.
Do YOU feel like your SCC construction doesn't do enough? Then I have a patch for you! SCCs can now do everything! Well, almost.
This patch has been extracted from #123720. It specifically enhances
Sccs
to allow tracking arbitrary commutative properties (think min/max mappings on nodes vs arbitrary closures) of strongly connected components, includingThis helps with among other things universe computation. We can now identify
SCC universes as a reasonably straightforward "find max/min" operation during SCC construction. This is also included in this patch.
It's also more or less zero-cost; don't use the new features, don't pay for them.
This commit also vastly extends the documentation of the SCCs module, which I had a very hard time following. It may or may not have gotten easier to read for someone else.
I believe this logic can also be used in leak check, but haven't checked. Ha. ha. Ha.