Skip to content
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

libtest: Fix padding of benchmarks run as tests #118548

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Dec 2, 2023

Summary

The first commit adds regression tests for libtest padding.

The second commit fixes padding for benches run as tests and updates the blessed output of the regression tests to make it clear what effect the fix has on padding.

Closes #104092 which is E-help-wanted and regression-from-stable-to-stable

More details

Before this fix we applied padding before manually doing what convert_benchmarks_to_tests() does which affects padding calculations. Instead use convert_benchmarks_to_tests() first if applicable and then apply padding afterwards so it becomes correct.

Benches should only be padded when run as benches to make it easy to compare the benchmark numbers. Not when run as tests.

r? @ghost until CI passes.

As you can see the padding is wrong when running benches as tests. This
will be fixed in the next commit. (Benches should only be padded when
run as benches to make it easy to compare the benchmark numbers.)
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 2, 2023
@Enselic Enselic changed the title Bench padding libtest: Fix padding of benchmarks run as tests Dec 2, 2023
@rustbot

This comment was marked as outdated.

@Enselic
Copy link
Member Author

Enselic commented Dec 2, 2023

r? @saethlin who last touched the code I am changing

@saethlin
Copy link
Member

saethlin commented Dec 2, 2023

This is good work and very well-tested, but I'm not a member of the library team. I'm asking on Zulip about who should be approving this.

@Enselic
Copy link
Member Author

Enselic commented Dec 5, 2023

r? @thomcc as discussed on Zulip.

@rustbot rustbot assigned thomcc and unassigned saethlin Dec 5, 2023
@thomcc
Copy link
Member

thomcc commented Dec 5, 2023

r? @thomcc

@thomcc
Copy link
Member

thomcc commented Dec 5, 2023

Seems good to me! Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2023

📌 Commit 809b2ad has been approved by thomcc

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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2023
@bors
Copy link
Contributor

bors commented Dec 6, 2023

⌛ Testing commit 809b2ad with merge f6543a7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 6, 2023
libtest: Fix padding of benchmarks run as tests

### Summary

The first commit adds regression tests for libtest padding.

The second commit fixes padding for benches run as tests and updates the blessed output of the regression tests to make it clear what effect the fix has on padding.

Closes rust-lang#104092 which is **E-help-wanted** and **regression-from-stable-to-stable**

### More details

Before this fix we applied padding _before_ manually doing what `convert_benchmarks_to_tests()` does which affects padding calculations. Instead use `convert_benchmarks_to_tests()` first if applicable and then apply padding afterwards so it becomes correct.

Benches should only be padded when run as benches to make it easy to compare the benchmark numbers. Not when run as tests.

r? `@ghost` until CI passes.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 6, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 6, 2023
Before this fix we applied padding before manually doing what
`convert_benchmarks_to_tests()` does. Instead use
`convert_benchmarks_to_tests()` if applicable and then apply padding
afterwards so it becomes correct. (Benches should only be padded when
run as benches to make it easy to compare the benchmark numbers.)
@Enselic
Copy link
Member Author

Enselic commented Dec 7, 2023

I had to replace \+ with \{1,\} in the normalization regex to make it work with both macOS/BSD sed and Linux/GNU sed.

@thomcc Can you r+ again please? Thanks! Diff from what you already approved.

@Enselic
Copy link
Member Author

Enselic commented Dec 23, 2023

@thomcc Friendly ping in case you missed my first ping (the diff from what you already approved is trivial).

@ChrisDenton
Copy link
Member

I'm happy to approve the diff.

@bors r=thomcc,ChrisDenton

@bors
Copy link
Contributor

bors commented Jan 12, 2024

📌 Commit 12e6bcf has been approved by thomcc,ChrisDenton

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 12, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 12, 2024
@bors
Copy link
Contributor

bors commented Jan 12, 2024

⌛ Testing commit 12e6bcf with merge 5431404...

@bors
Copy link
Contributor

bors commented Jan 12, 2024

☀️ Test successful - checks-actions
Approved by: thomcc,ChrisDenton
Pushing 5431404 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 12, 2024
@bors bors merged commit 5431404 into rust-lang:master Jan 12, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 12, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5431404): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

Results

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.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
3.8% [3.8%, 3.8%] 1
Improvements ✅
(primary)
-1.2% [-1.3%, -1.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.6% [-1.3%, 0.5%] 3

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: 666.091s -> 666.39s (0.04%)
Artifact size: 308.42 MiB -> 308.38 MiB (-0.01%)

@Enselic Enselic deleted the bench-padding branch January 12, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange indentation in libtest output
8 participants