Skip to content

Miri subtree update #127726

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 29 commits into from
Jul 14, 2024
Merged

Miri subtree update #127726

merged 29 commits into from
Jul 14, 2024

Conversation

RalfJung
Copy link
Member

r? @ghost

Mandragorian and others added 29 commits July 4, 2024 21:39
Currently cargo-miri uses the first target specified in the command
line. However, when multiple targets are specified in a `cargo build`
invocation, cargo will build for all of them.

Miri should match this behaviour to reduce surprises.

Fixes: rust-lang#3460
This is an attempt to remove the magic from a lot of the numbers tested,
which should make things easier when it is time to add `f16` and `f128`.
A nice side effect is that these tests now cover all int <-> float
conversions with the same amount of tests.

Co-authored-by: Ralf Jung <[email protected]>
…alfJung

Refactor float casting tests, add `f16` and `f128`

This is an attempt to remove the magic from a lot of the numbers tested, which makes things easier when adding `f16` and `f128`. A nice side effect is that these tests now cover all int <-> float conversions with the same amount of tests.
Run tests for all specified targets

Currently cargo-miri uses the first target specified in the command line. However, when multiple targets are specified in a `cargo build` invocation, cargo will build for all of them.

Miri should match this behaviour to reduce surprises.

Fixes: rust-lang#3460
implement `libc::sched_setaffinity` on linux

fixes rust-lang/miri#2749

the implementation, like `libc::sched_getaffinity`, just always returns `EINVAL`, which kind of simulates a device with zero cpus. I believe the idea is that callers of this function always do it to optimize, so they are likely to gracefully recover from this function returning an error.

based on the libc crate, these functions are also available on android and freebsd (but not on macos or windows). So should the implementation of the `sched_*` functions just be copied to the android and freebsd shims?
We have to compare unknown_bottom as well, it is semantically relevant!
Stacked Borrows: fix PartialEq for Stack

We have to compare unknown_bottom as well, it is semantically relevant! This could have merged two adjacent stacks that are not actually equal...
Implement support for multiple TLS destructors on macOS

I want to get rid of [this `#[cfg]` block](https://github.com/rust-lang/rust/blob/98dcbae5c9ac615d5acfbf42d42b19a77cb9ec11/library/std/src/thread/mod.rs#L195-L211) in `std`, but it is currently required for miri, as it does not support multiple macOS TLS destructors. This is not true for the platform itself, however, as can be observed in the [implementation](https://github.com/apple-oss-distributions/dyld/blob/d552c40cd1de105f0ec95008e0e0c0972de43456/dyld/DyldRuntimeState.cpp#L2239).
…s. Add tests for the new behavior.

libc::read shim had a bug: if underlying real call libc::read(fd, buf, N) returns M, then
libc::read shim writes N bytes to buf instead of M. Remaining N - M bytes are filled with zeros.
This commit fixes this bug and adds tests for new behavior
Fix libc::read shim: make it write to a buffer correct amount of bytes. Add tests for new behavior

libc::read shim had a bug: if underlying real call libc::read(fd, buf, N) returns M, then
libc::read shim writes N bytes to buf instead of M. Remaining N - M bytes are filled with zeros.
This commit fixes this bug and adds tests for new behavior
…RalfJung

add test for intermediate reference in '&(*x).0 as *const i32'
@rustbot
Copy link
Collaborator

rustbot commented Jul 14, 2024

The Miri subtree was changed

cc @rust-lang/miri

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 2024
@RalfJung
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Jul 14, 2024

📌 Commit e90f047 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 Jul 14, 2024
@bors
Copy link
Collaborator

bors commented Jul 14, 2024

⌛ Testing commit e90f047 with merge d9284af...

@bors
Copy link
Collaborator

bors commented Jul 14, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 14, 2024
@bors bors merged commit d9284af into rust-lang:master Jul 14, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 14, 2024
@rust-timer
Copy link
Collaborator

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

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

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

Bootstrap: 700.185s -> 701.292s (0.16%)
Artifact size: 328.67 MiB -> 328.63 MiB (-0.01%)

@RalfJung RalfJung deleted the miri-sync branch July 18, 2024 10:22
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.

8 participants