Skip to content

Miri subtree update #119039

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 40 commits into from
Dec 17, 2023
Merged

Miri subtree update #119039

merged 40 commits into from
Dec 17, 2023

Conversation

RalfJung
Copy link
Member

r? @ghost

Jefffrey and others added 30 commits December 3, 2023 23:05
This warns-by-default since 2 years and already has been added to the future-incompat group since Rust 1.68.

See rust-lang#79813 for the tracking issue.
Don't explicitly warn against `semicolon_in_expressions_from_macros`

This warns-by-default since 2 years and already has been added to the future-incompat group since Rust 1.68.

See rust-lang#79813 for the tracking issue.

Just something I noticed when trying to wrap my head around lints warned against in the rust-lang/rust and noticed it's not warned against anymore; let me know if the change makes sense 🙏
AFAIK `-Zunstable-options` is for `cargo --config` CLI,
which was stabilized in 1.63

https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#config-cli
…s, r=RalfJung

remove unnecesary `-Zunstable-options`

AFAIK `-Zunstable-options` is for `cargo --config` CLI, which was stabilized in 1.63

https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#config-cli
Move some x86 intrinsics code to helper functions in `shims::x86`

To make them reusable for intrinsics of other x86 features.

Splitted from rust-lang/miri#3192
`(op & mask) == 0` and `(op & mask) == mask` need each to be calculated for the whole vector.

For example, given
* `op = [0b100, 0b010]`
* `mask = [0b100, 0b110]`

The correct result would be:
* `op & mask = [0b100, 0b010]`
Comparisons are done on the vector as a whole:
* `all_zero = (op & mask) == [0, 0] = false`
* `masked_set = (op & mask) == mask = false`
* `!all_zero && !masked_set = true`

The previous method:
`op & mask = [0b100, 0b010]`
Comparisons are done element-wise:
* `all_zero = (op & mask) == [0, 0] = [true, true]`
* `masked_set = (op & mask) == mask = [true, false]`
* `!all_zero && !masked_set = [true, false]`
After folding with AND, the final result would be `false`, which is incorrect.
Fix x86 SSE4.1 ptestnzc

Fixes ptestnzc by bringing back the original implementation of rust-lang/miri#3214.

`(op & mask) != 0 && (op & mask) == !ask` need to be calculated for the whole vector. It cannot be calculated for each element and then folded.

For example, given
* `op = [0b100, 0b010]`
* `mask = [0b100, 0b110]`

The correct result would be:
* `op & mask = [0b100, 0b010]`
Comparisons are done on the vector as a whole:
* `all_zero = (op & mask) == [0, 0] = false`
* `masked_set = (op & mask) == mask = false`
* `!all_zero && !masked_set = true` correct result

The previous method:
* `op & mask = [0b100, 0b010]`
Comparisons are done element-wise:
* `all_zero = (op & mask) == [0, 0] = [true, true]`
* `masked_set = (op & mask) == mask = [true, false]`
* `!all_zero && !masked_set = [true, false]`
 After folding with AND, the final result would be `false`, which is incorrect.
Rustup

Pulls in rust-lang#117953 (in preparation for implementing those intrinsics)
Fix miri script target dir and update doc link

Fix ui_test doc link in `CONTRIBUTING.md`

Explicitly set `--target-dir` in `miri` script when building to expected location

- I have `build.target-dir` cargo config set to be some other location so miri script was erroring out since compiled binary was not in expected location
Return MAP_FAILED when mmap fails

I don't properly remember why we ended up with a hodgepodge of return values, but rust-lang/miri#3218 correctly points out that we are supposed to return `MAP_FAILED`. This should fix that return value and also add sufficient tests to prevent making a similar mistake.
tests: use Waker::noop instead of defining our own Waker
bors and others added 10 commits December 14, 2023 05:29
add test for uninhabited saved locals in a coroutine

adds the test from rust-lang#118871 in Miri as well
Visit the AllocIds and BorTags in borrow state FrameExtra

Fixes rust-lang/miri#3228

I said

> The obvious way would be to visit the AllocIds in borrow_tracker::FrameExtra in the GC.

Since I have had no new ideas, that's what this does.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 17, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 17, 2023

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Dec 17, 2023

📌 Commit 00a82a5 has been approved by RalfJung

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

bors commented Dec 17, 2023

⌛ Testing commit 00a82a5 with merge 5151b8c...

@bors
Copy link
Collaborator

bors commented Dec 17, 2023

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 5151b8c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 17, 2023
@bors bors merged commit 5151b8c into rust-lang:master Dec 17, 2023
@rustbot rustbot added this to the 1.76.0 milestone Dec 17, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5151b8c): 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)
-3.6% [-3.9%, -3.3%] 2
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 673.096s -> 671.366s (-0.26%)
Artifact size: 312.45 MiB -> 312.39 MiB (-0.02%)

@RalfJung RalfJung deleted the miri branch December 22, 2023 11:24
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants