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

Remove NtPat, NtMeta, and NtPath #137517

Merged
merged 3 commits into from
Mar 1, 2025

Conversation

nnethercote
Copy link
Contributor

Another part of #124141.

r? @petrochenkov

@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. labels Feb 24, 2025
@nnethercote
Copy link
Contributor 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 Feb 24, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2025
…r=<try>

Remove `NtPat`, `NtItem`, and `NtStmt`

Another part of rust-lang#124141.

r? `@petrochenkov`
@bors
Copy link
Contributor

bors commented Feb 24, 2025

⌛ Trying commit 96229ed with merge e6d1e42...

@rust-log-analyzer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

The recursion_limit overflow occurs in x doc compiler. Interestingly, it doesn't happen in #124141 which does the full nonterminal removal. I tried the individual commits:

ok    Remove `NtPat`.
bad   Remove `NtItem` and `NtStmt`.
bad   More denesting of invisibly-delimited groups.
bad   Remove `NtMeta`.
bad   Remove `NtPath`.
bad   Remove `NtExpr` and `NtLiteral`.
bad   Fix a problem with metavars and inner attributes.
ok    Remove `NtBlock`, `Nonterminal`, and `TokenKind::Interpolated`.
ok    Impl `Copy` for `Token` and `TokenKind`.
ok    Remove `TokenStream::flattened` and `InvisibleOrigin::FlattenToken`.

Somehow removing Nonterminal is enough to fix the problem. I was planning to merge these commits gradually, over multiple PRs, but maybe I'll just do NtPat in this PR and then the following seven commits in the next PR, because I don't know how else to work around this problem. (Increasing the recursion_limit to 256 looks like it would be necessary in lots of crates.)

@bors
Copy link
Contributor

bors commented Feb 24, 2025

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e6d1e42): 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)
2.2% [0.2%, 3.1%] 14
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) 2.2% [0.2%, 3.1%] 14

Max RSS (memory usage)

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

Cycles

Results (primary 2.6%, secondary -2.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)
2.6% [1.6%, 3.1%] 12
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.8%, -2.1%] 2
All ❌✅ (primary) 2.6% [1.6%, 3.1%] 12

Binary size

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

Bootstrap: 770.178s -> 769.585s (-0.08%)
Artifact size: 359.64 MiB -> 359.66 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 Feb 24, 2025
@nnethercote nnethercote force-pushed the rm-NtPat-NtItem-NtStmt branch from 96229ed to 372af98 Compare February 24, 2025 21:26
@nnethercote nnethercote changed the title Remove NtPat, NtItem, and NtStmt Remove NtPat Feb 24, 2025
@nnethercote
Copy link
Contributor Author

I will restrict this to just the NtPat removal to avoid the doc problems. Let's try perf again.

@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 Feb 24, 2025
@bors
Copy link
Contributor

bors commented Feb 24, 2025

⌛ Trying commit 372af98 with merge 2c86f0c...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2025
…r=<try>

Remove `NtPat`

Another part of rust-lang#124141.

r? `@petrochenkov`
@bors
Copy link
Contributor

bors commented Feb 24, 2025

☀️ Try build successful - checks-actions
Build commit: 2c86f0c (2c86f0c5832c30bbbfcb2fc9fd9de4eefacf8303)

@rust-timer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

I want to cancel that perf run. Let's see if closing the PR will do that.

@nnethercote nnethercote reopened this Feb 25, 2025
@nnethercote nnethercote changed the title Remove NtPat Remove NtPat, NtMeta, and NtPath Feb 25, 2025
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Feb 28, 2025

💔 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 Feb 28, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-apple-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
downloading https://ci-artifacts.rust-lang.org/rustc-builds/cb08599451226d780b2490f1aa9b414fe9e36657/rust-dev-nightly-x86_64-apple-darwin.tar.xz
extracting /Users/runner/work/rust/rust/build/cache/llvm-cb08599451226d780b2490f1aa9b414fe9e36657-false/rust-dev-nightly-x86_64-apple-darwin.tar.xz to /Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm

thread 'main' panicked at src/bootstrap/src/core/download.rs:346:17:
member.unpack_in(dst) failed with failed to unpack `/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-split`
Build completed unsuccessfully in 0:00:45
  local time: Fri Feb 28 09:51:55 UTC 2025
  network time: Fri, 28 Feb 2025 09:51:55 GMT
##[error]Process completed with exit code 1.

@nnethercote
Copy link
Contributor Author

@bors retry

@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 Feb 28, 2025
@jieyouxu
Copy link
Member

@bors p=5 (rollup scheduling; contains a fix for a P-critical issue)

@bors
Copy link
Contributor

bors commented Feb 28, 2025

⌛ Testing commit 50076cd with merge aa3c2d7...

@bors
Copy link
Contributor

bors commented Mar 1, 2025

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing aa3c2d7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 1, 2025
@bors bors merged commit aa3c2d7 into rust-lang:master Mar 1, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 1, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aa3c2d7): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

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

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.3% [0.2%, 0.4%] 16
Regressions ❌
(secondary)
0.4% [0.3%, 0.6%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 16

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 771.31s -> 770.727s (-0.08%)
Artifact size: 361.99 MiB -> 361.98 MiB (-0.00%)

@nnethercote nnethercote deleted the rm-NtPat-NtItem-NtStmt branch March 2, 2025 21:23
@nnethercote
Copy link
Contributor Author

The perf regressions are expected and unavoidable, alas.

@rustbot label: +perf-regression-triaged

tgross35 added a commit to tgross35/rust that referenced this pull request Mar 3, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 4, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 4, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 4, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 5, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 5, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 5, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 5, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 5, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Mar 6, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
Noratrieb added a commit to Noratrieb/rust that referenced this pull request Mar 6, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Mar 6, 2025
…cote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in rust-lang#137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes rust-lang#137662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants