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

#124141 preliminaries #132629

Merged
merged 4 commits into from
Nov 21, 2024
Merged

#124141 preliminaries #132629

merged 4 commits into from
Nov 21, 2024

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Nov 5, 2024

Preliminary changes required to start removing Nonterminal (#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 Nov 5, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@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 Nov 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2024
…<try>

rust-lang#124141 preliminaries

Preliminary changes required to start removing `Nonterminal`.

r? `@petrochenkov`
@bors
Copy link
Contributor

bors commented Nov 5, 2024

⌛ Trying commit 3266ef9 with merge feea15e...

@bors
Copy link
Contributor

bors commented Nov 5, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (feea15e): 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)
0.2% [0.1%, 0.5%] 59
Regressions ❌
(secondary)
0.3% [0.1%, 0.6%] 33
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 2
All ❌✅ (primary) 0.2% [0.1%, 0.5%] 59

Max RSS (memory usage)

Results (secondary 4.5%)

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)
4.5% [3.2%, 5.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary 9.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)
9.7% [9.4%, 9.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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: 781.474s -> 782.28s (0.10%)
Artifact size: 335.25 MiB -> 335.33 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 5, 2024
compiler/rustc_ast/src/token.rs Show resolved Hide resolved
compiler/rustc_ast/src/token.rs Outdated Show resolved Hide resolved
compiler/rustc_ast/src/token.rs Outdated Show resolved Hide resolved
@petrochenkov
Copy link
Contributor

Quite a few perf regressions, do you know what is the reason? Are they avoidable?
@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2024
@nnethercote
Copy link
Contributor Author

nnethercote commented Nov 13, 2024

The regressions are smaller when I benchmark locally, so it's hard to tell exactly what's happening. But I suspect there are two possible causes:

  • We used to just skip all invisible delimiters, but now we only skip some, which involves an extra check. This is most important in TokenCursor::inlined_next which is very hot. This is impossible to avoid.
  • The extra cases added to can_begin_*/may_be_* will make those functions slightly slower. Once Nonterminal is removed some of the old cases will be removed, so any effect here should eventually disappear.

The regressions are mostly in incr-unchanged runs, where parsing/expansion performance changes are magnified. I can't see how to avoid these for now.

@rustbot label: +perf-regression-triaged

@nnethercote
Copy link
Contributor Author

@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 18, 2024
@petrochenkov
Copy link
Contributor

r=me after removing the remaining glob imports (#132629 (comment)).
@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2024
It's not used meaningfully yet, but will be needed to get rid of
interpolated tokens.
Pasted metavariables are wrapped in invisible delimiters, which
pretty-print as empty strings, and changing that can break some proc
macros. But error messages saying "expected identifer, found ``" are
bad. So this commit adds support for metavariables in `TokenDescription`
so they print as "metavariable" in error messages, instead of "``".

It's not used meaningfully yet, but will be needed to get rid of
interpolated tokens.
Current places where `Interpolated` is used are going to change to
instead use invisible delimiters. This prepares for that.
- It adds invisible delimiter cases to the `can_begin_*`/`may_be_*`
  methods and the `failed_to_match_macro` that are equivalent to the
  existing `Interpolated` cases.
- It adds panics/asserts in some places where invisible delimiters
  should never occur.
- In `Parser::parse_struct_fields` it excludes an ident + invisible
  delimiter from special consideration in an error message, because
  that's quite different to an ident + paren/brace/bracket.
It was added in rust-lang#130349, but it's not used meaningfully, and causes
difficulties for Nonterminal removal in rust-lang#124141.
@bors
Copy link
Contributor

bors commented Nov 20, 2024

📌 Commit 03159d4 has been approved by petrochenkov

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

bors commented Nov 21, 2024

⌛ Testing commit 03159d4 with merge 31e990b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 21, 2024
…petrochenkov

rust-lang#124141 preliminaries

Preliminary changes required to start removing `Nonterminal` (rust-lang#124141).

r? `@petrochenkov`
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Nov 21, 2024

💔 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 Nov 21, 2024
@matthiaskrgr
Copy link
Member

Run src/ci/scripts/setup-upstream-remote.sh
Configuring https://github.com/rust-lang/rust remote as upstream.
fatal: unable to access 'https://github.com/rust-lang/rust/': Failed to connect to github.com port 443: Connection timed out

@bors retry Failed to connect to github.com port 443: Connection timed out

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

bors commented Nov 21, 2024

⌛ Testing commit 03159d4 with merge acafcf5...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 21, 2024
…petrochenkov

rust-lang#124141 preliminaries

Preliminary changes required to start removing `Nonterminal` (rust-lang#124141).

r? `@petrochenkov`
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests\run-make\avr-rjmp-offset stdout ----

error: rmake recipe failed to complete
status: exit code: 1
command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake.exe"
--- stderr -------------------------------
command failed at line 29
command failed at line 29
Command { cmd: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake_out" "avr-rjmp-offsets.rs" "-Copt-level=s" "-Cpanic=abort" "--target=avr-unknown-gnu-atmega328" "-Clinker=rust-lld" "-Clink-arg=--entry=main" "-o" "compiled", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe", defused: true, armed_location: Location { file: "C:\\a\\rust\\rust\\tests\\run-make\\avr-rjmp-offset\\rmake.rs", line: 16, col: 5 } }, already_executed: true }
output status: `exit code: 1`
=== STDOUT ===


=== STDERR ===
error: linking with `rust-lld` failed: exit code: 0xc0000374
error: linking with `rust-lld` failed: exit code: 0xc0000374
  |
  = note: "rust-lld" "-flavor" "gnu" "C:\\a\\_temp\\msys64\\tmp\\rustc3Mz6if\\symbols.o" "compiled.avr_rjmp_offsets.ab053966543a1f9f-cgu.0.rcgu.o" "--as-needed" "-Bdynamic" "-z" "noexecstack" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake_out" "-o" "compiled" "--gc-sections" "--entry=main"

error: aborting due to 1 previous error
------------------------------------------

@bors
Copy link
Contributor

bors commented Nov 21, 2024

💔 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 Nov 21, 2024
@nnethercote
Copy link
Contributor Author

@bors retry because it smells like a random linker crash

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

bors commented Nov 21, 2024

⌛ Testing commit 03159d4 with merge 717f5df...

@bors
Copy link
Contributor

bors commented Nov 21, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 21, 2024
@bors bors merged commit 717f5df into rust-lang:master Nov 21, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 21, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (717f5df): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.2% [0.1%, 0.3%] 29
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.3%] 5
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 29

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.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: 796.195s -> 795.947s (-0.03%)
Artifact size: 335.92 MiB -> 336.01 MiB (0.03%)

nnethercote added a commit to nnethercote/rust that referenced this pull request Nov 25, 2024
Notes about tests:

- tests/ui/parser/macro/trait-object-macro-matcher.rs: the syntax error
  is duplicated, because it occurs now when parsing the decl macro
  input, and also when parsing the expanded decl macro. But this won't
  show up for normal users due to error de-duplication.

- tests/ui/associated-consts/issue-93835.rs: ditto.

- The changes to metavariable descriptions in rust-lang#132629 are now visible in
  error message for several tests.
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-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.

7 participants