Skip to content

Miri Experiment #3297

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Miri Experiment #3297

wants to merge 3 commits into from

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Mar 25, 2025

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs developer guidelines

Extra:

Pull Request Details 📖

Description

This isn't intended to get merged (especially not as is)! It's just for exploring and discussing if and how we could make use of MIRI

Testing

n/a

@bjoernQ bjoernQ added the skip-changelog No changelog modification needed label Mar 25, 2025
@@ -3663,7 +3663,7 @@ macro_rules! spi_instance {
#[inline(always)]
fn info(&self) -> &'static Info {
static INFO: Info = Info {
register_block: crate::peripherals::[<SPI $num>]::regs(),
register_block: crate::peripherals::[<SPI $num>]::ptr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this compiles? 👀

@MabezDev
Copy link
Member

MabezDev commented Apr 3, 2025

This is interesting! Thanks for looking in to this!

I'm curious if we can just run all (or a subset) of our HIL tests with miri enabled? That would feel a bit more useful than writing seperate miri specific tests, I think. I've never actually tested any of my projects with MIRI though, so I'm not sure how it's typically used.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Apr 3, 2025

I thought about how we could test usual driver code - one thing that might be possible would be to have a forked svd2rust which produces mock-PACs which Miri won't hate (it definitely hates writing / reading to / from random addresses) - and also our drivers expect something to happen when we write to the hw-registers

I think that could work - I am just not very sure if it's a good deal in terms of effort vs benefit - but would definitely be fun to explore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants