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

Differences to MiniRust (aka the idealized interpreter) #2159

Open
7 of 8 tasks
RalfJung opened this issue May 28, 2022 · 0 comments
Open
7 of 8 tasks

Differences to MiniRust (aka the idealized interpreter) #2159

RalfJung opened this issue May 28, 2022 · 0 comments
Labels
C-project Category: a larger project is being tracked here, usually with checkmarks for individual steps

Comments

@RalfJung
Copy link
Member

RalfJung commented May 28, 2022

MiniRust is basically an idealized Miri. There are many differences between the two that stem from the fact that Miri is a tool you can actually use, but some differences end up being observable during program execution and those are Miri bugs or pragmatic hacks to paper over lack of a properly designed language feature -- basically, if we can fix them all, then Miri becomes a reference interpreter for Rust! But until then, Miri's results have more grains of salt than just "there could be implementation bugs".

More fundamentally, whenever there is non-determinism, Miri has a hard time. Ideally Miri would explore every possible MiniRust execution with some non-zero probability, but that is not currently the case:

  • Allocation base addresses are not assigned completely arbitrarily
  • Preemption of concurrent threads happens only at the end of each basic block, not after each access to global state
  • "Guessing" a suitable provenance over-approximates the actually allowed set of programs

Additionally, Stacked Borrows is full of hacks (from the &mut Unpin situation to the magic retagging for return places, not to mention two-phase borrows and extern types), so breaking changes should be expected in the aliasing model.

And finally, until we have a proper operational weak memory model, we cannot even say whether our data race detection and weak memory load emulation precisely matches the spec.

@RalfJung RalfJung added the C-project Category: a larger project is being tracked here, usually with checkmarks for individual steps label Jun 5, 2022
@RalfJung RalfJung changed the title Differences to MiniRust Differences to MiniRust (aka the idealized interpreter) Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-project Category: a larger project is being tracked here, usually with checkmarks for individual steps
Projects
None yet
Development

No branches or pull requests

1 participant