Skip to content

Conversation

@michaliskok
Copy link
Contributor

@michaliskok michaliskok commented Nov 16, 2025

This PR bumps the GenMC version to 0.15.1:

  • LLVM is no longer required to build the GenMC library. This results to faster build times and likely unblocks Enable MacOS support for GenMC mode. #4571
  • Invalid configs do not cause GenMC to panic now. Instead, GenMC returns a list of warnings/errors that Miri can use as it sees fit. (The code currently just aborts.)
  • Miri may now pass debugging information to GenMC so that better error reports are produced. (Currently unused.)
  • GenMC's scheduler returns the reason a given execution was dropped, so no heuristics have to be used in Miri.

r? @RalfJung
(Each commit can be reviewed separately.)

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Nov 16, 2025
@RalfJung
Copy link
Member

Looks like CI has some trouble:


    /home/runner/work/miri/miri/genmc-sys/genmc-src/src/ExecutionGraph/ExecutionGraph.cpp: In member function 'void ExecutionGraph::validate()':
    /home/runner/work/miri/miri/genmc-sys/genmc-src/src/ExecutionGraph/ExecutionGraph.cpp:496:38: error: 'print' is not a member of 'std'; did you mean 'printf'?
      496 |                                 std::print(std::cerr, "Non-existent RF: {}\n{}\n", rLab->getPos(),
          |                                      ^~~~~
          |                                      printf

CI should be using g++ 13.2. Is that not new enough for std::print...?

@RalfJung
Copy link
Member

RalfJung commented Nov 16, 2025

Yeah apparently that needs GCC 14.1. I don't know whether there's a way to get that on Github's CI. But even if there is, if not even Ubuntu 24 has a new enough GCC I'm quite concerned that this might just be too recent. New GCC versions tend to spread very slowly and we can't make it too hard for people to build Miri.

@RalfJung RalfJung added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Nov 16, 2025
@michaliskok
Copy link
Contributor Author

Yeah apparently that needs GCC 14.1. I don't know whether there's a way to get that on Github's CI. But even if there is, if not even Ubuntu 24 has a new enough GCC I'm quite concerned that this might just be too recent. New GCC versions tend to spread very slowly and we can't make it too hard for people to build Miri.

I'm a bit surprised that cmake configure didn't fail. But anyway I'll ensure it builds with 13.2.

GenMC (v0.14.1) no longer depends on LLVM when built as a library.
This commit adjust genmc building and shim accordingly.
GenMC v0.14.1 does not throw an error internally if the config
is invalid, but rather returns an appropriate error value.
This commit has setup code in Miri check the returned value,
and exit if there are any errors.
The new error-reporting mechanism of GenMC changed its public API.
This commit adjusts the Miri interface accordingly (all driver
calls need an extra argument that represents possible debugging
information).
When GenMC says that an execution should not be explored further,
Miri needs to know why (e.g., so that it returns an appropriate
exit value). Until now, some (erroneous) heuristics were used
for that.

This commit changes the Miri/GenMC API to check the scheduling
result of GenMC (that now reflects the "stop type").
Now GenMC can be built as a standalone library, without
LLVM dependencies.
@michaliskok
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Nov 16, 2025
@RalfJung
Copy link
Member

Looks great, thanks!

@RalfJung RalfJung added this pull request to the merge queue Nov 17, 2025
Merged via the queue into rust-lang:master with commit 38c7c59 Nov 17, 2025
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants