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

Implement mir_load_module #1863

Merged
merged 1 commit into from
May 10, 2023
Merged

Implement mir_load_module #1863

merged 1 commit into from
May 10, 2023

Conversation

RyanGlScott
Copy link
Contributor

This implements an experimental mir_load_module command, the first SAW command dedicated to MIR (Rust) code. I have added a basic test case to kick the tires and ensure that everything works as you would expect. You can't do much with the resulting MIR module yet (besides printing it in the SAW REPL), but more functionality for verifying the MIR code will come in future patches.

Note that in order to produce a MIR JSON file suitable for SAW's needs, you must build your Rust code with one of the two mir-json tools added in GaloisInc/mir-json#41.

This checks off one box in #1859.

Comment on lines 1717 to 1718
* `CRUX_RUST_LIBRARY_PATH` should point to the the MIR files for the Rust
standard library. TODO RGS: Describe how to produce this
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The name "CRUX_RUST_LIBRARY_PATH" is somewhat unfortunate here, as SAW is a completely separate tool from Crux. This needn't be a blocker for this patch, but we should consider renaming CRUX_RUST_LIBRARY_PATH to something else going forward. I have opened GaloisInc/mir-json#43 to track this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GaloisInc/mir-json#46 introduces SAW_RUST_LIBRARY_PATH as an alias for CRUX_RUST_LIBRARY_PATH, and I've updated the SAW manual to reference the former. The explanation for how to know where to point SAW_RUST_LIBRARY_PATH is still somewhat unsatisfactory, but I think may need to include a copy of the MIR-ified Rust standard library in SAW bindists before we can provide better documentation. I've added a reminder to do this as a checkbox in #1859.

Copy link
Contributor

@spernsteiner spernsteiner left a comment

Choose a reason for hiding this comment

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

I don't really know the saw-script codebase, but this seems reasonable to me. The actual mir_load_module implementation looks good.

@RyanGlScott RyanGlScott added the ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. label May 5, 2023
This implements an experimental `mir_load_module` command, the first SAW
command dedicated to MIR (Rust) code. I have added a basic test case to kick
the tires and ensure that everything works as you would expect. You can't do
much with the resulting MIR module yet (besides printing it in the SAW REPL),
but more functionality for verifying the MIR code will come in future patches.

Note that in order to produce a MIR JSON file suitable for SAW's needs, you
must build your Rust code with one of the two `mir-json` tools added in
GaloisInc/mir-json#41.

This checks off one box in #1859.
@RyanGlScott RyanGlScott marked this pull request as ready for review May 10, 2023 02:57
@mergify mergify bot merged commit df95bf4 into master May 10, 2023
@mergify mergify bot deleted the T1859-mir_load_module branch May 10, 2023 06:30
@RyanGlScott RyanGlScott added the crucible/mir Related to crucible-mir verification label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crucible/mir Related to crucible-mir verification ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants