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

[CN-exec] Runtime loop invariants #884

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

rbanerjee20
Copy link
Contributor

Implementation of runtime loop invariant checking within Fulminate

… and add plumbing through to executable spec for whole loop location
…ng+decl for sym_addr_cn

Previous commit message with backticks didn't work
@bcpierce00
Copy link
Collaborator

Question about defaults: If I run with instrumentation on a file with no annotations, will I get dinged for missing loop invariants? I know there was some discussion about this a while back, but I'm not sure where we settled. (FWIW, I think it's better for loop invariant checking to be off by default, to provide a smoother onramp for new users, testing tutorial readers, etc.)

@cp526
Copy link
Collaborator

cp526 commented Feb 21, 2025

Question about defaults: If I run with instrumentation on a file with no annotations, will I get dinged for missing loop invariants? I know there was some discussion about this a while back, but I'm not sure where we settled. (FWIW, I think it's better for loop invariant checking to be off by default, to provide a smoother onramp for new users, testing tutorial readers, etc.)

Agreed. Ideally the specifying of a loop invariant itself is what turns the invariant checking on locally, just for that invariant.

@bcpierce00
Copy link
Collaborator

bcpierce00 commented Feb 22, 2025 via email

@rbanerjee20
Copy link
Contributor Author

rbanerjee20 commented Feb 25, 2025

Thanks @bcpierce00 @cp526 for your comments. I've now added some functionality for keeping track of whether the user has provided any CN loop spec. If they have, the loop gets instrumented with runtime checks; otherwise, no checks get inserted. Previously, the statements that CN generates internally whenever it sees a loop were also being translated and inserted by Fulminate. I agree that it doesn't make sense to make the output verbose with these checks if the user has not written any spec for their loop.

@cp526 if you could take a look at this commit this set of commits, that would be good, as I made a small change to Mucore.Label and had to propagate this throughout the CN codebase. If there is some better/easier way of keeping track of whether the user has provided any loop annotations, please let me know.

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.

4 participants