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

add track_caller for arith ops #114841

Merged
merged 1 commit into from Nov 29, 2023
Merged

add track_caller for arith ops #114841

merged 1 commit into from Nov 29, 2023

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Aug 15, 2023

Fixes #114814

#[track_caller] is works, r? @scottmcm

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 15, 2023
@scottmcm
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 15, 2023
@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Trying commit d766ba4dac43f02a637e5780b0f975298f90ee04 with merge cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f...

@bors
Copy link
Contributor

bors commented Aug 15, 2023

☀️ Try build successful - checks-actions
Build commit: cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f (cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking 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.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -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.6% [0.4%, 0.7%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 4

Bootstrap: 631.44s -> 633.211s (0.28%)
Artifact size: 346.64 MiB -> 346.61 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 15, 2023
@rust-log-analyzer

This comment has been minimized.

@apiraino
Copy link
Contributor

apiraino commented Oct 5, 2023

think I can remove T-compiler from the review of this PR

@rustbot label -T-compiler

@rustbot rustbot removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 5, 2023
@workingjubilee
Copy link
Contributor

Looks like this is no longer just div and mod? Can we have the PR description/title updated?

@@ -194,6 +195,7 @@ pub trait Sub<Rhs = Self> {
/// assert_eq!(12 - 1, 11);
/// ```
#[must_use = "this returns the result of the operation, without modifying the original"]
#[track_caller]
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, @bvanjoi, can you remind me why this is best on the trait here, rather than on the implementation that has the #[rustc_inherit_overflow_checks]? (Like the one at line 212 below.)

It's not clear to me that we should force this on everyone's Sub::sub.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I recall, placing it here was simply a means to reduce some of the code

Like the one at line 212 below.

Thank you for your reminder. I agree that it forms a better approach.

@scottmcm
Copy link
Member

scottmcm commented Oct 6, 2023

Since this was updated since the last run, let's double-check perf here:
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2023
@bors
Copy link
Contributor

bors commented Oct 6, 2023

⌛ Trying commit 28b88c9 with merge a18f635...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2023
fix: add track_caller attr for div and mod

Fixes rust-lang#114814

`#[track_caller]` is works, r? `@scottmcm`
@bors
Copy link
Contributor

bors commented Oct 6, 2023

☀️ Try build successful - checks-actions
Build commit: a18f635 (a18f63521ab8c04741ecb96b8cd93398b1b96e55)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a18f635): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking 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.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -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.3% [0.3%, 0.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Cycles

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

Binary size

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.1% [0.0%, 0.2%] 13
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.2%] 13

Bootstrap: 624.133s -> 624.61s (0.08%)
Artifact size: 270.63 MiB -> 270.68 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2023
@Dylan-DPC Dylan-DPC removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 5, 2023
TaKO8Ki added a commit to TaKO8Ki/rust that referenced this pull request Nov 9, 2023
add track_caller for arith ops

Fixes rust-lang#114814

`#[track_caller]` is works, r? ``@scottmcm``
@scottmcm
Copy link
Member

Since it looks like there hasn't been a change since one of the new tests in this failed in #114841 (comment)

@bors r-

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 18, 2023
@scottmcm
Copy link
Member

Re-rolling as I took myself off the libcore rotation,
r? libs

@rustbot rustbot assigned cuviper and unassigned scottmcm Nov 18, 2023
@bvanjoi
Copy link
Contributor Author

bvanjoi commented Nov 23, 2023

I've added ignore-wasm32 test header in the latest patch. @rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 23, 2023
@cuviper
Copy link
Member

cuviper commented Nov 28, 2023

@bors r+ rollup=never
(making sure we test its perf again after landing)

@bors
Copy link
Contributor

bors commented Nov 28, 2023

📌 Commit fc87d6e has been approved by cuviper

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 Nov 28, 2023
@bors
Copy link
Contributor

bors commented Nov 29, 2023

⌛ Testing commit fc87d6e with merge b1e56de...

@bors
Copy link
Contributor

bors commented Nov 29, 2023

☀️ Test successful - checks-actions
Approved by: cuviper
Pushing b1e56de to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Nov 29, 2023

☀️ Test successful - checks-actions
Approved by: cuviper
Pushing b1e56de to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 29, 2023
@bors bors merged commit b1e56de into rust-lang:master Nov 29, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 29, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b1e56de): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.3% [0.2%, 0.4%] 6
Regressions ❌
(secondary)
0.7% [0.2%, 1.3%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 3
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 6

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
Regressions ❌
(secondary)
1.8% [1.7%, 1.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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
Regressions ❌
(secondary)
2.2% [1.7%, 2.5%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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.1% [0.0%, 0.1%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 8

Bootstrap: 672.968s -> 673.535s (0.08%)
Artifact size: 313.36 MiB -> 313.39 MiB (0.01%)

@cuviper
Copy link
Member

cuviper commented Nov 29, 2023

IMO, the perf loss is unfortunate but pretty minor, especially weighed against the diagnostic gain.

@lqd
Copy link
Member

lqd commented Nov 29, 2023

Also it's mostly in rustdoc, and the one debug benchmark affected looks a bit noisy.

@lqd
Copy link
Member

lqd commented Nov 29, 2023

@rustbot label: +perf-regression-triaged

:3

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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

Unusual Panic Location for Dividing by a Reference to Zero