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 ignore-rustc-debug-assertions to tests/ui/associated-consts/issue-93775.rs #134608

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

DianQK
Copy link
Member

@DianQK DianQK commented Dec 21, 2024

Closes #132111. Closes #133432.

I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack.

IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size).

After set rust.debug-assertions is true, the test case requires a larger call stack, so disable it on rust.debug-assertions=true.

r? jieyouxu

try-job: x86_64-msvc
try-job: i686-msvc

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 21, 2024
@jieyouxu
Copy link
Member

I think moving to crashes is reasonable. Looking at this version, it should hit the limits across platforms much more reliably?

I'll run two msvc try jobs (the try jobs succeeding doesn't guarantee they won't be flaky, but just as a basic sanity check). If they come back green, then please r=me.

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
Move test rust-lang#93775 to crashes

Closes rust-lang#132111. Closes rust-lang#133432. Re-opens rust-lang#93775.

I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack.

IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size).

r? jieyouxu

try-job: x86_64-msvc
try-job: i686-msvc
@bors
Copy link
Contributor

bors commented Dec 21, 2024

⌛ Trying commit 091613d with merge f4e6d38...

@bors
Copy link
Contributor

bors commented Dec 21, 2024

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

@DianQK
Copy link
Member Author

DianQK commented Dec 21, 2024

🟩
@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Dec 21, 2024

📌 Commit 091613d has been approved by jieyouxu

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 21, 2024
DianQK added a commit to DianQK/rust that referenced this pull request Dec 21, 2024
Move test rust-lang#93775 to crashes

Closes rust-lang#132111. Closes rust-lang#133432. Re-opens rust-lang#93775.

I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack.

IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size).

r? jieyouxu

try-job: x86_64-msvc
try-job: i686-msvc
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 21, 2024
Move test rust-lang#93775 to crashes

Closes rust-lang#132111. Closes rust-lang#133432. Re-opens rust-lang#93775.

I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack.

IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size).

r? jieyouxu

try-job: x86_64-msvc
try-job: i686-msvc
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#131072 (Win: Use POSIX rename semantics for `std::fs::rename` if available)
 - rust-lang#134325 (Correctly document CTFE behavior of is_null and methods that call is_null.)
 - rust-lang#134526 (update `rustc_index_macros` feature handling)
 - rust-lang#134581 (Bump Fuchsia toolchain for testing)
 - rust-lang#134607 (on pair → on par)
 - rust-lang#134608 (Move test rust-lang#93775 to crashes)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-

#134613 (comment)

@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 Dec 21, 2024
@DianQK
Copy link
Member Author

DianQK commented Dec 22, 2024

I will add RUST_MIN_STACK later.

@rustbot author

@DianQK DianQK changed the title Move test #93775 to crashes Add ignore-rustc-debug-assertions to tests/ui/associated-consts/issue-93775.rs Dec 22, 2024
@DianQK
Copy link
Member Author

DianQK commented Dec 22, 2024

When enable rust.debug-assertions, I can notice it requires larger call stacks to handle it, however if I disable it, rustc can even compile the following code:

#![recursion_limit = "8193"]

use std::marker::PhantomData;

struct Z;
struct S<T>(PhantomData<T>);

type Nested4<T> = S<S<S<S<T>>>>;
type Nested16<T> = Nested4<Nested4<Nested4<Nested4<T>>>>;
type Nested64<T> = Nested16<Nested16<Nested16<Nested16<T>>>>;
type Nested256<T> = Nested64<Nested64<Nested64<Nested64<T>>>>;
type Nested1024<T> = Nested256<Nested256<Nested256<Nested256<T>>>>;
type Nested4096<T> = Nested1024<Nested1024<Nested1024<Nested1024<T>>>>;
type Nested8192<T> = Nested4096<Nested4096<T>>;

type Nested = Nested8192<Z>;

trait AsNum {
    const NUM: u32;
}

impl AsNum for Z {
    const NUM: u32 = 0;
}

impl<T: AsNum> AsNum for S<T> {
    const NUM: u32 = T::NUM + 1;
}

fn main() {
    let _ = Nested::NUM;
}
$ time rustc +nightly 93775.rs --out-dir /tmp/93775
rustc +nightly 93775.rs --out-dir /tmp/93775  17.96s user 79.23s system 99% cpu 1:37.74 total

So I disable the test case when disable rust.debug-assertions.

@jieyouxu
Copy link
Member

Huh...

@jieyouxu
Copy link
Member

I guess we'll have to see in full CI... r=me after PR CI is green.

@bors rollup=iffy

@DianQK
Copy link
Member Author

DianQK commented Dec 22, 2024

I guess we'll have to see in full CI... r=me after PR CI is green.

IIUC, only tasks that have DEPLOY environment or running on apple platform disable debug-assertions.
Free to try them if you'd like.

@DianQK
Copy link
Member Author

DianQK commented Dec 22, 2024

BTW, I can reproduce the crash at 091613d if I enable debug-assertions on my local Mac mini.

@DianQK
Copy link
Member Author

DianQK commented Dec 22, 2024

🟩
@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Dec 22, 2024

📌 Commit 4dca485 has been approved by jieyouxu

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 Dec 22, 2024
@jieyouxu
Copy link
Member

IIUC, only tasks that have DEPLOY environment or running on apple platform disable debug-assertions. Free to try them if you'd like.

I marked this PR as iffy, if it fails full CI, oh well :3

@bors
Copy link
Contributor

bors commented Dec 23, 2024

⌛ Testing commit 4dca485 with merge 66bb586...

@bors
Copy link
Contributor

bors commented Dec 23, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing 66bb586 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 23, 2024
@bors bors merged commit 66bb586 into rust-lang:master Dec 23, 2024
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 23, 2024
@DianQK DianQK deleted the disable-93775 branch December 23, 2024 09:52
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (66bb586): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (secondary 3.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.

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

Cycles

Results (secondary -3.3%)

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)
-3.3% [-3.8%, -2.1%] 11
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 763.42s -> 762.559s (-0.11%)
Artifact size: 330.55 MiB -> 330.61 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
6 participants