Skip to content

Differences to MiniRust (aka the idealized interpreter) #2159

Open
@RalfJung

Description

@RalfJung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-projectCategory: a larger project is being tracked here, usually with checkmarks for individual steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions