Replies: 12 comments 14 replies
-
In the "Threats to Validity" section, the authors state that it is possible to have a transformation with a counterexample that is wider than 64 bits, but Alive will verify its correctness because of its bounded verification. I have two questions about this:
|
Beta Was this translation helpful? Give feedback.
-
We can use Alive DSL to write peephole optimization pass, and prove it to be correct formally. Then Alive can turn it into C++ code that can be linked into LLVM and used as an LLVM optimization pass. Here my question is: how is the efficiency comparing "C++ code generated by Alive" and "manually-written and optimized LLVM pass"? Maybe when the optimzation becomes more complex, the C++ code generated by Alive would have a lot more redundant and useless code? In Section 4, the author mentioned that some cleanup work will be done by the subsequent dead-code elimination pass. But it is able to clean all the redundancy effectively? Maybe it would be better to evaluate more on the compilation time (LLVM+Alive vs. LLVM 3.6) |
Beta Was this translation helpful? Give feedback.
-
From a philosophical view, this work seems like a perfect application of formal verification to reduce bugs in real-world programs. It will likely always be challenging to create fully formally verified software, but the approach used in this paper of formally verifying common sub-components in a program seems like a good way to introduce some level of formal verification. This paper also shows the importance of a good DSL to access the tool. Catering this DSL to its potential users within the llvm project probably made it much more likely to be used in real-world code. I'm confused about how memory is encoded into SMT without the theory of arrays and why this would be faster than using the theory of arrays? |
Beta Was this translation helpful? Give feedback.
-
Overall, I agree with Andrew that I really liked how they picked a narrow enough problem that they could formally verify it, while putting it in a widely used enough tool for it to be useful for people. In the paper they mentioned trying to rewrite an LLVM pass themselves, as well as reviewing proposed patches for errors. Impressively, it looks like the project is still going, and has even been updated in the last week!! I think it's worth thinking about factors that helped make this project easier for people to use, and got people motivated enough to keep working on it. |
Beta Was this translation helpful? Give feedback.
-
I found the technique of reducing the verification problem to down to a SMT equation to be quite interesting, and also enjoyed the generality that Alive provides in matching LLVM IR code to optimize. I'm curious about the efficiency of the Alive verification using the SMT solver. In particular, I saw that in the paper, larger bitwidths can cause the verification time to take several hours. I imagine this verification method also fails to scale well when there are more than a few instructions considered in the peephole optimization. I wonder if this failure to scale can be partially ameliorated by having multiple smaller peephole optimizations, which could speed up verification time. |
Beta Was this translation helpful? Give feedback.
-
Finding 8 bugs over the course of a research project aimed to reduce bugs sounds like a big win to me. I wonder what they would find if applied it to more parts of llvm. They argue alive is practical. I’d be curious to know if there are lots more than 8 bugs to be fixed. If there’s not many more, how practical is it to use alive? What has been the case since this paper? |
Beta Was this translation helpful? Give feedback.
-
I find it very interesting that there are three types of undefined behaviours in LLVM. I'm a bit surprised about two things:
|
Beta Was this translation helpful? Give feedback.
-
I think that I am a little bit concerned (or confused) by the mention that Alive does not support branching. Isn't that very limiting? Furthermore, how could Alive be correlated to formal specification methods/languages like TLA+? |
Beta Was this translation helpful? Give feedback.
-
In the paper it was mentioned that Alive is parametric over types, and so for it to be correct it must be correct for all possible type inferences of a given program. In particular it needs to use an SMT solver to enumerate all these satisfiable type assignments and then check the correctness over all of them. I wonder if there are better ways to accomplish the same goal. For example, maybe we can require the program is equipped with some type annotations? Or maybe something like the ML type inference thingy where the weakest type assignments are selected and also proving that the correctness of programs propogate from weaker type assignments to stronger ones? |
Beta Was this translation helpful? Give feedback.
-
I think this paper shows that combining a DSL and a SMT solver could be super powerful. Having a DSL to describe both source and target semantics gives a clearly defined scope of verifiable optimizations. One thing I really like about this tool is that it's not super complex but it's actually practical in real world cases. Compared to previous work, for example, CompCert. Alive is reasonably light-weighted. My main concern is, there are just so many different abstractions existing in LLVM, and given this fact, how would the DSL have enough expressiveness for abstractions like memory models or uncommon data types? I feel like the synthesize part is nice addition, but not a necessary/key part of the paper (having a practical optimization properly specified and verified is already very useful), so I am not too concerned with any issues from that part. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the wonderful discussion yesterday---especially to @atucker for leading us! Here are a few follow-up links & notes based on stuff that came up in the discussion:
|
Beta Was this translation helpful? Give feedback.
-
Thanks everyone for the great discussion in class! I wrote up a blog post for the paper, with a pull request here, and a reasonably readable version of the page here. Let me know what you all think! |
Beta Was this translation helpful? Give feedback.
-
This is the discussion thread for Provably Correct Peephole Optimizations with Alive
Nuno P. Lopes, David Menendez, Santosh Nagarakatte, and John Regehr. PLDI 2015!
Hosted by Aaron Tucker.
Beta Was this translation helpful? Give feedback.
All reactions