Skip to content

Use u64 for incr comp allocation offsets #113562

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
Jul 17, 2023

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Jul 11, 2023

Fixes #76037
Fixes #95780
Fixes #111613

These issues are all reporting ICEs caused by using u32 to store offsets to allocations in the incremental compilation cache. This PR aims to lift that limitation by changing the offset type in question to u64.

There are two perf runs in this PR. The first reports a regression, and the second does not. The changes are the same in both. I rebased the PR then did the second perf run because I noticed that the primary regression in it was very commonly seen in spurious regression reports.

I do not know what the perf run will report when this is merged. I would not be surprised to see regression or neutral, but the cachegrind diffs for the regression point at try_mark_previous_green which is a common source of inexplicable regressions and I don't think should be perturbed by this PR.

I'm not opposed to adding a regression test such as

fn main() {
    println!("{}", [37; 1 << 30].len());
}

But that program takes 1 minute to compile and consumes 4.6 GB of memory then writes that much to disk. Is that a concerning amount of resource use for a test?

r? @nnethercote

@saethlin saethlin added the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Jul 11, 2023
@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 Jul 11, 2023
@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 Jul 11, 2023
@bors
Copy link
Collaborator

bors commented Jul 11, 2023

⌛ Trying commit c157ed5ebb2c7a774fe4e33032261f4ec5335dad with merge 95e855e355817d2ab0983eae1b0c1c2bc192b552...

@bors
Copy link
Collaborator

bors commented Jul 11, 2023

☀️ Try build successful - checks-actions
Build commit: 95e855e355817d2ab0983eae1b0c1c2bc192b552 (95e855e355817d2ab0983eae1b0c1c2bc192b552)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (95e855e355817d2ab0983eae1b0c1c2bc192b552): comparison URL.

Overall result: ❌ regressions - 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.8% [0.5%, 1.2%] 36
Regressions ❌
(secondary)
0.7% [0.4%, 0.8%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.5%, 1.2%] 36

Max RSS (memory usage)

Results

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.7% [4.7%, 4.7%] 1
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-1.0%, -1.0%] 1

Cycles

Results

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)
3.4% [1.2%, 5.0%] 8
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [1.2%, 5.0%] 8

Binary size

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

Bootstrap: 656.708s -> 657.823s (0.17%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 11, 2023
@saethlin saethlin force-pushed the larger-incr-comp-offset branch from c157ed5 to 752f285 Compare July 13, 2023 21:48
@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 Jul 13, 2023
@bors
Copy link
Collaborator

bors commented Jul 13, 2023

⌛ Trying commit 752f2857bf8e77932ff8f05d8194f36494714949 with merge 895ebafae6f9467924efe5ea4721c573424631c0...

@bors
Copy link
Collaborator

bors commented Jul 13, 2023

☀️ Try build successful - checks-actions
Build commit: 895ebafae6f9467924efe5ea4721c573424631c0 (895ebafae6f9467924efe5ea4721c573424631c0)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

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

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.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
6.1% [6.1%, 6.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.3%, -2.6%] 4
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 1

Cycles

Results

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)
-2.5% [-2.7%, -2.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% [-2.7%, -2.3%] 2

Binary size

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

Bootstrap: 658.555s -> 658.567s (0.00%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 14, 2023
@saethlin saethlin removed the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Jul 14, 2023
@saethlin saethlin marked this pull request as ready for review July 14, 2023 02:56
@rustbot
Copy link
Collaborator

rustbot commented Jul 14, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@oli-obk
Copy link
Contributor

oli-obk commented Jul 14, 2023

But that program takes 1 minute to compile and consumes 4.6 GB of memory then writes that much to disk. Is that a concerning amount of resource use for a test?

Yea that seems not great. But I also don't think it's too useful a test, as it is hard to regress again

@RalfJung
Copy link
Member

RalfJung commented Jul 14, 2023 via email

@nnethercote
Copy link
Contributor

Should there be a comment somewhere explaining why u64 is needed?

Indeed, there are no comments in the commit and no explanation in the PR. What's the motivation here?

@saethlin saethlin force-pushed the larger-incr-comp-offset branch from 752f285 to 4e117a9 Compare July 14, 2023 21:06
@nnethercote
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 17, 2023

📌 Commit 4e117a9 has been approved by nnethercote

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 Jul 17, 2023
@bors
Copy link
Collaborator

bors commented Jul 17, 2023

⌛ Testing commit 4e117a9 with merge 6f65ef5...

@bors
Copy link
Collaborator

bors commented Jul 17, 2023

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing 6f65ef5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 17, 2023
@bors bors merged commit 6f65ef5 into rust-lang:master Jul 17, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 17, 2023
@rust-timer
Copy link
Collaborator

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

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.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Cycles

Results

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.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
-3.5% [-3.5%, -3.5%] 1
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -3.5% [-3.5%, -3.5%] 1

Binary size

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

Bootstrap: 657.644s -> 656.437s (-0.18%)

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