Added testing harness for proofs from rust input#542
Merged
Conversation
cd4e14e to
cb58c32
Compare
ehildenb
added a commit
that referenced
this pull request
Apr 30, 2025
As part of #542, we noticed that the `Dockerfile` does not install Rust, and we need it for integration tests run there. This PR makes sure `rustc` and `cargo` are available to run in the docker image for CI: - The `rustup` install step is moved to inside the docker image. - The steps for building KMir in the tests "Integration with stable-mir-json" are all moved to being in the docker image. --------- Co-authored-by: devops <devops@runtimeverification.com>
jberthold
reviewed
Apr 30, 2025
Comment on lines
+97
to
+100
| def cargo_get_smir_json(rs_file: Path) -> dict[str, Any]: | ||
| smir_json_result = SMIR_JSON_DIR / rs_file.with_suffix('.smir.json').name | ||
| run_process_2(['cargo', 'run', '--', '-Zno-codegen', str(rs_file)], cwd=SMIR_JSON_DIR) | ||
| json_smir = json.loads(smir_json_result.read_text()) |
Collaborator
There was a problem hiding this comment.
Remark: This does not actually have to use cargo, it is a single crate because it starts from a single Rust file.
We don't have linking for multi-crate programs atm, but let's still use cargo here (recompilation might become a bit tricky, though)
jberthold
approved these changes
Apr 30, 2025
Collaborator
jberthold
left a comment
There was a problem hiding this comment.
As discussed, let's merge this and follow up making it a command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new testing harness that for running rust proofs. In particular we:
cargo_get_smir_jsonthat runs Stable MIR JSON through cargo on a given rust file (all very hardcoded right now)tests/integration/data/prove-rsof rust programs to prove do not end in error state or break assertionstest_prove_rsto generate a claims for the test rust files and then prove those claimsTwo tests are currently added, one that expects a pass, one that expects a fail and both work. I also tested putting incorrect values in there and they did fail as expected.
NEXT STEPS
gen-specusesubanddivproofs