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

Use constant eval to do strict mem::uninit/zeroed validity checks #99033

Merged
merged 1 commit into from
Jul 17, 2022

Conversation

5225225
Copy link
Contributor

@5225225 5225225 commented Jul 8, 2022

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging @RalfJung since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 8, 2022
@rust-highfive
Copy link
Collaborator

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Jul 8, 2022

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 8, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 8, 2022

r? @oli-obk

will look at this next week

@rust-highfive rust-highfive assigned oli-obk and unassigned nagisa Jul 8, 2022
@rust-log-analyzer

This comment has been minimized.

@5225225
Copy link
Contributor Author

5225225 commented Jul 9, 2022

Weird.... I wouldn't expect that check to fail. Both because even under strict checks, you should be able to zero init a sigaction, and we shouldn't be running under strict checks here.

@rust-log-analyzer

This comment has been minimized.

@5225225 5225225 force-pushed the interpreter-validity-checks branch from 837e402 to b398fa5 Compare July 9, 2022 16:34
@oli-obk
Copy link
Contributor

oli-obk commented Jul 11, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 11, 2022

📌 Commit 236c7c0 has been approved by oli-obk

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 11, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 11, 2022
…, r=oli-obk

Use constant eval to do strict mem::uninit/zeroed validity checks

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 12, 2022
…, r=oli-obk

Use constant eval to do strict mem::uninit/zeroed validity checks

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
@Dylan-DPC
Copy link
Member

failed in rollup

@5225225 5225225 force-pushed the interpreter-validity-checks branch from ccad3da to 27412d1 Compare July 14, 2022 22:00
@oli-obk
Copy link
Contributor

oli-obk commented Jul 15, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 15, 2022

📌 Commit ccad3da4fca1b55a5c9ce7ffc1e5938efa1bb8b5 has been approved by oli-obk

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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 15, 2022
@JohnTitor

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@bors
Copy link
Contributor

bors commented Jul 17, 2022

📌 Commit ccad3da4fca1b55a5c9ce7ffc1e5938efa1bb8b5 has been approved by oli-obk

It is now in the queue for this repository.

@Dylan-DPC
Copy link
Member

bors issue, reöpening

@Dylan-DPC Dylan-DPC closed this Jul 17, 2022
@Dylan-DPC Dylan-DPC reopened this Jul 17, 2022
@Dylan-DPC
Copy link
Member

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jul 17, 2022

📌 Commit 27412d1 has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 17, 2022

⌛ Testing commit 27412d1 with merge 665a4971c64ae03bac1ed8656ac292f78ecbc0db...

@RalfJung
Copy link
Member

@bors retry dist-x86_64-apple-alt is hanging (in "complete job" stage of GHA)

@bors
Copy link
Contributor

bors commented Jul 17, 2022

⌛ Testing commit 27412d1 with merge 263edd4...

@bors
Copy link
Contributor

bors commented Jul 17, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 263edd4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 17, 2022
@bors bors merged commit 263edd4 into rust-lang:master Jul 17, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 17, 2022
@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)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (263edd4): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.2% -2.9% 6
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
1.6% 1.6% 1
Regressions 😿
(secondary)
2.1% 2.9% 4
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 1.6% 1.6% 1

Cycles

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
3.0% 3.0% 1
Regressions 😿
(secondary)
5.1% 5.3% 2
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.0% 3.0% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@5225225 5225225 deleted the interpreter-validity-checks branch July 17, 2022 23:01
JohnTitor pushed a commit to JohnTitor/rust that referenced this pull request Jul 26, 2022
…r=oli-obk

Use constant eval to do strict mem::uninit/zeroed validity checks

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
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
Development

Successfully merging this pull request may close these issues.