Remove -Zinline-in-all-cgus and clean up tests/codegen-units/ by saethlin · Pull Request #133929 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation30 Commits1 Checks6 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

saethlin

Implementation of rust-lang/compiler-team#814

I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of tests/codegen-units and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using -Zprint-mono-items=lazy in the partitioning tests improves that.

I've also deleted some of the tests/run-make/sepcomp tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.

@rustbot rustbot added A-run-make

Area: port run-make Makefiles to rmake.rs

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Dec 5, 2024

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@saethlin saethlin changed the titleRemove -Zinline-in-all-cgus Remove -Zinline-in-all-cgus and clean up tests/codegen-units/

Dec 31, 2024

@saethlin saethlin marked this pull request as ready for review

January 5, 2025 18:33

@rustbot

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

jieyouxu

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only comment on the compiler/ changes and the run-make test removal, which LGTM. The actual codegen-units test diffs is probably better suited for @nnethercote to review after their vacation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these docss 💙

```
MONO_ITEM @@ [] []
```
DO NOT add tests to this suite that use `-Zprint-mono-items=eager`, that flag changes the way that MonoItem collection works in rather fundamental ways that are otherwise only used by `-Clink-dead-code`, and thus the MonoItems collected and their linkage under `-Zprint-mono-items=eager` does not correlate very well with normal compilation behavior.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: almost makes me think this should be a separate codegen-units-partitioning suite, which bans -Zprint-mono-items=eager in compile-flags, but anyway.

@RalfJung

I've often fought a lot with the contents of tests/codegen-units and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed.

I just ran into this as well. The README you added is only for the partitioning tests; is there anything useful to say about codegen-units tests more broadly? A top-level README telling contributors what to do when they see a failure in that folder could be useful.


@jieyouxu you unassigned yourself without picking a new reviewer. Was that deliberate? Someone should be in charge of the PR...

r? compiler

@saethlin

Just to avoid reviewer hot-potato:
r? nnethercote

@rustbot

Could not assign reviewer from: nnethercote.
User(s) nnethercote are either the PR author, already assigned, or on vacation, and there are no other candidates.
Use r? to specify someone else to assign.

@saethlin

The README you added is only for the partitioning tests; is there anything useful to say about codegen-units tests more broadly?

They are all based on -Zprint-mono-items, but other than that no. The codegen-units tests are for checking that items are assigned to the right CGU, and the item-collection tests are for checking that items were collected at all. Some of the item-collection tests also check which CGU an item was assigned to and with what linkage. I think those cases come from contributors not realizing that they can just say // MONO_ITEM <item name> @@ to ignore the CGU partitioning.

I want to work on the item-collection tests separately, because they are mostly but not all based on -Zprint-mono-iteam=eager, which primarily exists to collect MonoItems from dead code, but most of the tests also have #![deny(dead_code)].

@jieyouxu

@jieyouxu you unassigned yourself without picking a new reviewer. Was that deliberate? Someone should be in charge of the PR...

No, I thought nnethercote was already assigned...

@bors

nnethercote

nnethercote

# codegen-units/partitioning tests
This test suite is designed to test that codegen unit partitioning works as intended.
Note that it does not evaluate whether CGU partitioning is *good*, that is the job of the compiler benchmark suite.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence has a comma splice which you don't need to fix but lots of people don't know about them so I thought I'd mention it for educational purposes :) (I'd change the comma to a period to fix it.)

nnethercote

```
MONO_ITEM @@ [] []
```
DO NOT add tests to this suite that use `-Zprint-mono-items=eager`, that flag changes the way that MonoItem collection works in rather fundamental ways that are otherwise only used by `-Clink-dead-code`, and thus the MonoItems collected and their linkage under `-Zprint-mono-items=eager` does not correlate very well with normal compilation behavior.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first comma is another comma splice, lol

@nnethercote

Removes a crusty old -Z flag, removes low-value tests, adds documentation? Yes please!

r=me, I'll let you fix the tiny English flaws, only the "of" one matters at all.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jan 28, 2025

Zalathar added a commit to Zalathar/rust that referenced this pull request

Jan 28, 2025

@Zalathar

…, r=nnethercore

Remove -Zinline-in-all-cgus and clean up tests/codegen-units/

Implementation of rust-lang/compiler-team#814

I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of tests/codegen-units and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using -Zprint-mono-items=lazy in the partitioning tests improves that.

I've also deleted some of the tests/run-make/sepcomp tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 28, 2025

@bors

@Zalathar

@bors bors added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Jan 28, 2025

@saethlin

@saethlin

@saethlin

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 28, 2025

@bors

…r=

Remove -Zinline-in-all-cgus and clean up tests/codegen-units/

Implementation of rust-lang/compiler-team#814

I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of tests/codegen-units and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using -Zprint-mono-items=lazy in the partitioning tests improves that.

I've also deleted some of the tests/run-make/sepcomp tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.

try-job: x86_64-gnu-nopt

@bors

☀️ Try build successful - checks-actions
Build commit: 75620fd (75620fdde39563b7b572f5f1cc6a77f7a9dd3753)

@saethlin

@bors

📌 Commit bf9df97 has been approved by nnethercote

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jan 28, 2025

Zalathar added a commit to Zalathar/rust that referenced this pull request

Jan 28, 2025

@Zalathar

…, r=nnethercote

Remove -Zinline-in-all-cgus and clean up tests/codegen-units/

Implementation of rust-lang/compiler-team#814

I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of tests/codegen-units and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using -Zprint-mono-items=lazy in the partitioning tests improves that.

I've also deleted some of the tests/run-make/sepcomp tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 28, 2025

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@bors

@bors

@bors bors mentioned this pull request

Jan 28, 2025

@rust-timer

Finished benchmarking commit (aa6f5ab): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 0.4% [0.4%, 0.4%] 1
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.0%, secondary -1.1%)

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.

mean range count
Regressions ❌ (primary) 0.9% [0.9%, 0.9%] 1
Regressions ❌ (secondary) - - 0
Improvements ✅ (primary) -0.9% [-0.9%, -0.9%] 1
Improvements ✅ (secondary) -1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) -0.0% [-0.9%, 0.9%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 773.228s -> 773.088s (-0.02%)
Artifact size: 328.20 MiB -> 328.30 MiB (0.03%)

@saethlin saethlin deleted the remove-inline-in-all-cgus branch

January 28, 2025 14:12

Labels

A-run-make

Area: port run-make Makefiles to rmake.rs

A-testsuite

Area: The testsuite used to check the correctness of rustc

merged-by-bors

This PR was explicitly merged by bors.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.