Commit graph

21 commits

Author SHA1 Message Date
Michalis Kokologiannakis
0bcadabb23 genmc/api: Use returned value for handleExecutionEnd() 2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
5e6d9fa6a5 genmc/api: Use returned value from handleFree()
GenMC's handleFree() does return an optional<Error>, so we
may as well use that value.
2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
fafd6de3ce genmc/api: Remove unnecessary comments
These comments explain the default values used internally
in (some) calls of the GenMC library, which is unnecessary.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
d2176c36a1 genmc/api: Don't use macros for mutex state
Use scoped constexprs instead.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
286fac035a genmc/api: Prefer early exits to joining if/else clauses 2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
e2c62e49c1 genmc/api: Use ERROR_ON instead of if (cond) ERROR()
This commit makes the code a bit more compact by using ERROR_ON()
whenever possible. It also renames a particularly verbose variable
used in ERROR's condition.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
c357b65324 genmc/build,api: Move wrappers around GenMC API to single file
GenMC has a single API that was handled in a collection of different
files. This commit collects all API wrappers to Exploration.cpp.

(The Setup.cpp file remains intact as it contains setting translation
and setup functions.)
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
689358ab36 genmc/schedule: Handle new GenMC scheduling API
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").
2025-11-16 22:20:39 +01:00
Michalis Kokologiannakis
b6cc543c3b genmc/api: Handle new GenMC error API
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).
2025-11-16 22:20:39 +01:00
Michalis Kokologiannakis
fbdf4aa3bb genmc/setup: Check GenMC config validity
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.
2025-11-16 22:20:39 +01:00
Michalis Kokologiannakis
5df5103f99 genmc/build: Drop LLVM dependency from build
GenMC (v0.14.1) no longer depends on LLVM when built as a library.
This commit adjust genmc building and shim accordingly.
2025-11-16 22:20:38 +01:00
Ralf Jung
a47726f10c GenmcScalar: rename extra to provenance 2025-11-04 09:02:27 +01:00
Michalis Kokologiannakis
ec7c884a03 Use Github URL to fetch GenMC
This commit also modifies MiriInterface.hpp so that it is
compatible with GenMC's API.
2025-11-03 22:43:31 +01:00
Patrick-6
4203fe84fb Implement std::sync::Mutex interception in GenMC mode. 2025-10-07 15:32:57 +02:00
Patrick-6
574ff896d6 Implement support for temporal mixing of atomic/non-atomic accesses in GenMC mode.
Remove atomic initialization dummy writes from tests.
2025-10-01 12:35:59 +02:00
Patrick-6
8b38760176 Implement Pointer conversions to and from GenMC. Limitation: Borrow tracking must be disabled. Remove hacks for keeping all memory allocations in GenMC mode. 2025-09-29 19:12:54 +02:00
Patrick-6
1ec098878c Expand GenMC mode:
- Implement support for 'assume' statements.
- Improve scheduling and next instruction type determination.
- Improve GenMC mode documentation.

Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-23 15:35:10 +02:00
Patrick-6
2c1f1f0e9b Add GenMC estimation mode. Improve error handling and output printing. 2025-09-18 10:25:41 +02:00
Patrick-6
a70d78a552 Implement more features for GenMC mode
- Handling Compare-Exchange operations.
  - Limitation: Compare-Exchange currently ignores possibility of spurious failures.
  - Limitation: Compare-Exchange failure memory ordering is ignored.
    - Upgrade compare-exchange success ordering to avoid reporting non-existent bugs.
- Add warnings for GenMC mode for unsupported features.
- Add a lot of tests, including translation of GenMC litmus tests and Loom tests.
- Cleanup
2025-09-12 17:37:25 +02:00
Patrick-6
61af5da8df Implement more features for GenMC mode
- Support for atomic fences.
- Support for atomic read-modify-write (RMW).
- Add tests using RMW and fences.
- Add options:
  - to disable weak memory effects in GenMC mode.
  - to print GenMC execution graphs.
  - to print GenMC output message.
- Fix GenMC full rebuild issue and run configure step when commit changes.
- Do cleanup.

Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-07 23:51:17 +02:00
Patrick-6
c1be740564 Implement basic support for running Miri with GenMC.
- Implement memory allocation compatible with GenMC.
  - Extract address generator struct from Miri's allocator.
- Support thread creation and joining.
- Support atomic load and store.
- Support scheduling through GenMC.
- Add tests for GenMC mode.
- Add clang-format file for C++ code in Miri.
- Update genmc-sys crate license to MIT/Apache to match GenMC dependency.
- Add documentation for GenMC mode.

Note: this commit depends on changes to GenMC not yet upstreamed to its official repository.

Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-03 12:41:32 +02:00