-
Notifications
You must be signed in to change notification settings - Fork 49
additional transmute and transmute_unchecked harnesses #264
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
Conversation
Would be to happy hear your thoughts on this (@celinval, @feliperodri, or anyone else interested in this challenge). In particular, we would like to hear what you think about the completeness of part 1 of challenge 1 (i.e., is there anything major that Kani can do that isn't currently being verified here?). For our own thoughts on this, we refer to the above linked completeness document. Thank you! |
The new commit adds some harnesses for transmute/transmute_unchecked. In particular, it adds "2-way" harnesses for additional primitives (including floats), as well as for references, pointers, and slices. It also introduces a macro that generates these 2-way harnesses between more complex types (currently arrays, tuples, and structs). As always, any feedback is greatly appreciated! I'm especially wondering if there are other properties we want to verify in this "part 1" (i.e., harnesses for the transmute intrinsics directly), or if it makes sense to do the rest of the verification at the part 2/3/4 level. In any case, thanks in advance! |
Hi @thanhnguyen-aws, I've updated the PR to reflect your previous comments. Happy to hear your thoughts whenever you get a chance -- thanks! |
Hello, thanks for your hard work. I have some comments:
|
Thanks for the reply @thanhnguyen-aws! I was just getting back to work on this, and I just wanted to check a few things with you:
Happy to hear your thoughts whenever you get a chance, and thank you as always for your suggestions! |
I've added a new commit that demonstrates more completely what my last comment discusses (e.g., the modified should_succeed and should_fail harnesses). Please feel free to let me know if this is closer to what you were thinking, and if I might be misunderstanding anything (e.g., like my above comment discusses, this still uses stubbing, which does differ from one of your suggestions). Thanks! |
Hello, |
can we ping on a review here @tautschnig @qinheping @carolynzech ? thanks. |
c120797
Toward solving #19
This pr adds some additional harnesses for transmute_unchecked and transmute.
With this, we suspect that the main harnesses for part 1 of challenge 1 (verifying the transmute intrinsics directly) are there (besides adding more of the same kinds of harnesses, like the 2-way harnesses for more types). We go into more detail about what needs to be done for part 1, as well as what has been done and what can't be done here: https://docs.google.com/document/d/1zFGANNMx8mZ8fucKrN--ELwKASUPeP20THH6M_fQ7jg/edit?usp=sharing
Just one note: transmute has far fewer harnesses than transmute_unchecked here -- this is because it is not currently possible to write a wrapper for transmute, and it is thus not possible to write a function contract. A lot of the harnesses for transmute_unchecked test the function contract's validity clause, rather than the function itself, explaining this disparity.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.