Skip to content

Don't fold in Instantiate when there's nothing to fold #142317

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

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

compiler-errors
Copy link
Member

Maybe this helps idk

r? lcnr

@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 Jun 10, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 10, 2025

⌛ Trying commit cbd67db with merge 4b9e637

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 10, 2025
Don't fold in Instantiate when there's nothing to fold

Maybe this helps idk

r? lcnr
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 10, 2025
@compiler-errors
Copy link
Member Author

i feel like ive tested this before lol

@rust-bors
Copy link

rust-bors bot commented Jun 11, 2025

☀️ Try build successful (CI)
Build commit: 4b9e637 (4b9e63748fe7159cca76930c0864086580bb664a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4b9e637): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.1%, 0.5%] 2
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 4
Improvements ✅
(secondary)
-1.7% [-3.4%, -0.1%] 12
All ❌✅ (primary) -0.0% [-0.3%, 0.5%] 6

Max RSS (memory usage)

Results (primary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (secondary 2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.6%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 755.415s -> 754.049s (-0.18%)
Artifact size: 372.14 MiB -> 372.20 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 Jun 12, 2025
@compiler-errors
Copy link
Member Author

I think the perf wins outweigh the perf hits.

@rustbot ready

@@ -622,6 +622,10 @@ impl<I: Interner, T: TypeFoldable<I>> ty::EarlyBinder<I, T> {
where
A: SliceLike<Item = I::GenericArg>,
{
// Nothing to fold.
if !cfg!(debug_assertions) && args.is_empty() {
Copy link
Member Author

Choose a reason for hiding this comment

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

We still fold if cfg!(debug_assertions) since the arg folder can detect out of bound arg instantiations, and that's useful in debug builds.

I believe that this is morally a debug assertion, since we never expect it in practice.

Copy link
Contributor

Choose a reason for hiding this comment

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

instead of still folding with debug assertions, check whether the value has params.

r=me after this nit

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Jun 13, 2025

📌 Commit 2b52d65 has been approved by lcnr

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 Jun 13, 2025
@bors
Copy link
Collaborator

bors commented Jun 14, 2025

⌛ Testing commit 2b52d65 with merge 696433c...

bors added a commit that referenced this pull request Jun 14, 2025
Don't fold in Instantiate when there's nothing to fold

Maybe this helps idk

r? lcnr
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 14, 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 Jun 14, 2025
@compiler-errors
Copy link
Member Author

compiler-errors commented Jun 26, 2025

@bors r=lcnr

I ended up turning the debug_assert into an assert since this "fixes" a bunch of crashes that I think we should continue to let ICE.

@bors
Copy link
Collaborator

bors commented Jun 26, 2025

📌 Commit d032119 has been approved by lcnr

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 Jun 26, 2025
@bors
Copy link
Collaborator

bors commented Jun 28, 2025

⌛ Testing commit d032119 with merge 7ba34c7...

@bors
Copy link
Collaborator

bors commented Jun 28, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 7ba34c7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 28, 2025
@bors bors merged commit 7ba34c7 into rust-lang:master Jun 28, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 28, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing b63223c (parent) -> 7ba34c7 (this PR)

Test differences

Show 8 test diffs

8 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 7ba34c704529e7fcab80130c3fe40efe415d61b5 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 3249.6s -> 4664.6s (43.5%)
  2. x86_64-rust-for-linux: 2529.2s -> 2989.7s (18.2%)
  3. aarch64-gnu-debug: 3563.2s -> 4194.6s (17.7%)
  4. i686-gnu-2: 5375.5s -> 6244.2s (16.2%)
  5. mingw-check-1: 1525.7s -> 1748.4s (14.6%)
  6. dist-apple-various: 5667.8s -> 6431.7s (13.5%)
  7. x86_64-apple-1: 8791.0s -> 7634.6s (-13.2%)
  8. x86_64-gnu-llvm-20-1: 3222.4s -> 3638.0s (12.9%)
  9. x86_64-gnu-tools: 3324.1s -> 3713.2s (11.7%)
  10. armhf-gnu: 4395.3s -> 4875.5s (10.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7ba34c7): 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

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 3
Improvements ✅
(secondary)
-2.6% [-2.9%, -2.4%] 6
All ❌✅ (primary) 0.1% [-0.3%, 0.3%] 12

Max RSS (memory usage)

Results (secondary 4.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (secondary -3.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.3%, -3.1%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 690.587s -> 689.948s (-0.09%)
Artifact size: 372.13 MiB -> 371.76 MiB (-0.10%)

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

6 participants