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

Add conditions for generic compress and serialize functions #587

Merged
merged 17 commits into from
Sep 24, 2024

Conversation

mamonet
Copy link
Member

@mamonet mamonet commented Sep 17, 2024

This PR makes generic serialize.rs panic-free by adding the following changes

  • Add pre/post conditions for functions in generic serialize.rs and make sure they pass the verification (Keep functions of lower priority marked as lax - compress_then_serialize_5/compress_then_serialize_11)
  • Add conditions for compress functions in the following vector modules traits.rs/portable.rs/avx2.rs
  • Add conditions with proofs for high-level compress functions in vector/portable/compress.rs (no avx2 proofs are added yet)

@mamonet
Copy link
Member Author

mamonet commented Sep 23, 2024

I invested a fair amount of time trying to address the slow verification of functions in serialize module. Here is my observation, at some point of verifying stacked operations F* gets overwhelmed and starts to fail to resolve basic arithmetics and the process could take several minutes and may lead to endless loop of reasoning. To make sure a certain function is under threshold and has normal verification process, we have to determine the operations that SMT struggles with the most, such as nested loops or complex arithmetics, and make them opaque by using opaque_to_smt qualifier and revealing where needed. By using that feature, verifying Serialize module is done in seconds rather than a few minutes for each function. I think we should use that qualifier intensively as the proofs scale to make the verification process maintainable and to have a headroom for further modifications as the conditions are still volatile in the current state.

@karthikbhargavan karthikbhargavan merged commit 04a7e4f into dev Sep 24, 2024
48 checks passed
@karthikbhargavan karthikbhargavan deleted the dev-serialize branch September 24, 2024 16:28
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.

2 participants