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 some track_caller info to precondition panics #129658

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saethlin
Copy link
Member

r? @ghost

Thought of this while looking at #129642 (comment)

@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 27, 2024
@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member Author

@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 27, 2024
@bors
Copy link
Contributor

bors commented Aug 27, 2024

⌛ Trying commit 18e2a95 with merge 7798f9b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
Add some track_caller info to precondition panics

r? `@ghost`

Thought of this while looking at rust-lang#129642 (comment)
@@ -212,6 +212,7 @@ panic_const! {

/// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize on the caller.

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was involved in the discussion on the PR that added this comment in the first place :)
#102732

I created this PR in part to evaluate whether the code size concerns are ill-founded. I suspect they are.

@bors
Copy link
Contributor

bors commented Aug 27, 2024

☀️ Try build successful - checks-actions
Build commit: 7798f9b (7798f9b35d0cd727f26631c015620e3dfe62e1f6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7798f9b): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -2.7%)

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.7% [-3.1%, -2.3%] 2
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 749.925s -> 752.783s (0.38%)
Artifact size: 338.74 MiB -> 338.79 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 27, 2024
@saethlin
Copy link
Member Author

That looks possibly acceptable. Let's just see how bad this becomes?

@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 27, 2024
@bors
Copy link
Contributor

bors commented Aug 27, 2024

⌛ Trying commit 197c7b3 with merge 0e77a71...

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 27, 2024
Add some track_caller info to precondition panics

r? `@ghost`

Thought of this while looking at rust-lang#129642 (comment)
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 27, 2024

☀️ Try build successful - checks-actions
Build commit: 0e77a71 (0e77a71199b6b2f7fac064cdf0b55e84d7ccca61)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0e77a71): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 6
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

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

Cycles

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

Binary size

Results (primary 0.3%, secondary 0.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.3% [0.0%, 1.4%] 65
Regressions ❌
(secondary)
0.1% [0.0%, 0.5%] 35
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 1.4%] 65

Bootstrap: 749.925s -> 751.312s (0.18%)
Artifact size: 338.74 MiB -> 338.81 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 27, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ec378f3): comparison URL.

Overall result: ❌ regressions - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +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)
2.2% [0.2%, 7.1%] 5
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [0.2%, 7.1%] 5

Max RSS (memory usage)

Results (primary 4.6%, secondary 3.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.

mean range count
Regressions ❌
(primary)
4.6% [1.3%, 7.8%] 2
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.6% [1.3%, 7.8%] 2

Cycles

Results (primary 6.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)
6.1% [3.0%, 9.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.1% [3.0%, 9.2%] 2

Binary size

Results (primary 0.3%, secondary 0.2%)

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.3% [0.0%, 1.4%] 67
Regressions ❌
(secondary)
0.2% [0.0%, 0.7%] 30
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 1.4%] 67

Bootstrap: 767.853s -> 767.321s (-0.07%)
Artifact size: 330.92 MiB -> 330.89 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 9, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 24, 2024

☔ The latest upstream changes (presumably #134716) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Dec 24, 2024
@saethlin saethlin force-pushed the spare-a-crumb branch 2 times, most recently from cf92736 to 8bc387b Compare December 25, 2024 19:36
@rust-log-analyzer

This comment has been minimized.

jieyouxu added a commit to jieyouxu/rust that referenced this pull request Dec 26, 2024
… r=jieyouxu

fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc rust-lang#129658 (comment)

r? `@jieyouxu`
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 26, 2024
…=jieyouxu

fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc rust-lang#129658 (comment)

r? `@jieyouxu`
poliorcetics pushed a commit to poliorcetics/rust that referenced this pull request Dec 26, 2024
…=jieyouxu

fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc rust-lang#129658 (comment)

r? `@jieyouxu`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 27, 2024
fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang/rust#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc rust-lang/rust#129658 (comment)

r? `@jieyouxu`
poliorcetics pushed a commit to poliorcetics/rust that referenced this pull request Dec 28, 2024
…=jieyouxu

fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc rust-lang#129658 (comment)

r? `@jieyouxu`
@saethlin
Copy link
Member Author

@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 Dec 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2024
Add some track_caller info to precondition panics

r? `@ghost`

Thought of this while looking at rust-lang#129642 (comment)
@bors
Copy link
Contributor

bors commented Dec 29, 2024

⌛ Trying commit 5721464 with merge 4c2b10c...

@bors
Copy link
Contributor

bors commented Dec 30, 2024

☀️ Try build successful - checks-actions
Build commit: 4c2b10c (4c2b10c659df5d0eb5747b5b5f8f5a9246cb4ff9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c2b10c): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Max RSS (memory usage)

Results (primary 3.4%, secondary 3.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)
8.8% [8.8%, 8.8%] 1
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [-2.0%, 8.8%] 2

Cycles

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

Binary size

Results (primary 0.3%, secondary 0.2%)

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.3% [0.0%, 1.4%] 66
Regressions ❌
(secondary)
0.2% [0.0%, 0.7%] 40
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 1.4%] 66

Bootstrap: 761.047s -> 762.071s (0.13%)
Artifact size: 325.44 MiB -> 325.56 MiB (0.04%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 30, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 3, 2025

☔ The latest upstream changes (presumably #122565) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants