Conversation
00e21de to
57c564d
Compare
Codecov Report
@@ Coverage Diff @@
## master #1343 +/- ##
=======================================
Coverage 69.34% 69.35%
=======================================
Files 155 155
Lines 18473 18479 +6
Branches 4098 4098
=======================================
+ Hits 12811 12816 +5
+ Misses 3888 3886 -2
- Partials 1774 1777 +3
|
db25738 to
215b441
Compare
ccadar
left a comment
There was a problem hiding this comment.
Hi @251 I took a look at the first (giant) commit and I like the changes quite a lot, although I have quite a number of small comments, which I'll do later directly in the code.
However, what I don't like is the removal of --silent-klee-assume and --dump-states-on-halt. I don't think the new --write-tests option can be used to replicate them exactly.
For --silent-klee-assume there are scenarios where you just want to ignore invalid klee-assumes while still dumping early test cases.
Similarly, for --dump-states-on-halt there are scenarios where you don't want to dump states on halt but still want to write other types of early test cases.
Unless I misunderstand the changes, I also don't like the fact that you now don't output states on solver errors.
Thanks again for these nice changes!
I made a copy/paste mistake in the description above. A failed assume is in the "User"(-error) category that only contains things like failing assumes or wrong number of arguments provided to KLEE's API functions. Suppressing this category after initial testing might be fine. So, should I split that category or keep the option? I'd prefer keeping the user category as the number of handled cases is small and very specific and getting rid of the
That sounds like I should split that category but what are those use cases?
It's off by default. I think it's probably not the best idea to query the solver for a state when a previous query failed but I can change that of course. |
|
@251 I took another look at this PR, and while I think the first commit requires a longer discussion, I think commits 2 and 4 should each form a separate PR, and could be merged quickly. |
215b441 to
3e13f8a
Compare
|
Could you please have another look to discuss this? I trimmed the PR down as requested and added the I've kept |
3e13f8a to
8d57080
Compare
|
Hi @251 , again, thanks again for this PR. I still like it, but it's way too large, both in terms of number of API changes as well as sheer lines of code, to review effectively. If you are willing to give it another try, here is what I suggest:
|
8d57080 to
2ed9d6c
Compare
|
@ccadar I've removed the test generation part. |
ccadar
left a comment
There was a problem hiding this comment.
Almost there, just some minor comments.
include/klee/Core/TerminationTypes.h
Outdated
|
|
||
|
|
||
| #define TERMINATION_TYPES \ | ||
| TTYPE(RUNNING,0U,"") \ |
There was a problem hiding this comment.
This doesn't look clang-formatted. Also, why 0U and not just 0?
There was a problem hiding this comment.
Thanks for having a look!
Also, why 0U and not just 0?
Because I want unsigned literals.
There was a problem hiding this comment.
But I don't see why here you need to be explicit with the "U" suffix. It looks ugly, unnecessarily.
There was a problem hiding this comment.
Maybe not here but in the future one might re-use the macros in a different context and I'd prefer to assign the correct type to the literal instead of relying on implicit conversions (which cause too many bugs).
There was a problem hiding this comment.
Can I ask why you force unsigned to begin with? All the code that I've seen uses ints, and avoids the ugly "1U". I'd be curious to understand your choice.
There was a problem hiding this comment.
Can I ask why you force unsigned to begin with?
Because this is intended domain and I store it in a 1 byte unsigned enum directly below.
All the code that I've seen uses ints
For what? E.g. Misra C/C++ enforces 'U' for unsigned constants. For literals >2^31 C (imho) doesn't even specify what you actually get (signed or unsigned) and for smaller values you have to rely on the word width of the host. Too many rules to remember for me...
There was a problem hiding this comment.
enum class'es are by default backed by signed ints in C++11. I feel you're over-optimising here -- as far as space goes, we won't have more than 100 termination reasons. But as I said, if you really like this, ok, it's minor.
There was a problem hiding this comment.
we won't have more than 100 termination reasons
But we might have a lot of leaf nodes with termination reason in svg files or sqlite databases.
There was a problem hiding this comment.
Ah, I see what you mean, but I don't understand what this has to do with signed vs unsigned, we will not need so many termination reasons.
There was a problem hiding this comment.
Anyway, you seem to really like this optimization, so we can keep it, although as a reader I was wondering why we need the explicit unsigned constants, when we have so few different termination categories.
| clEnumValN(StateTerminationType::ReportError, "ReportError", | ||
| "klee_report_error called"), | ||
| clEnumValN(Executor::User, "User", "Wrong klee_* functions invocation"), | ||
| #ifdef SUPPORT_KLEE_EH_CXX |
There was a problem hiding this comment.
I couldn't find a single use. Did I miss one?
There was a problem hiding this comment.
No, but perhaps it's something that we might need in the future? Can you see when this was added?
There was a problem hiding this comment.
OK, if there are no (planned) uses, I'm fine with this.
|
@ccadar I added a reformat commit. |
|
OK, let's try to merge this tonight! Just add those empty lines, reformat and squash the commits, and we can merge it! |
ed57818 to
b0ed918
Compare
Track all path terminations: esp. for debugging or visualising a persistent process tree (with or without full MoKlee integration) it is helpful to know the exact reason (StateTerminationType) why a path terminated.
b0ed918 to
be783e0
Compare
|
Alright, ready to merge! There are quite a number of uncovered lines (which is why codecov fails), and it would be nice to have test cases for each termination criteria. But since this is mostly a refactoring, we'll leave this under what you call Catch-22 and won't ask you to add tests ;) Of course, if you'd like to do this, let me know. Thanks again for this useful change, looking forward to the ones that had this as a dependency. |
I'd like to postpone it to another PR. The next will introduce BranchTypes and the following one the necessary statistics to test those cases more easily. |
|
@251 Sounds good, looking forward to the next ones (keep them small too!) |
Introduce
StateTerminationClass/Typeand assign type to every state terminationThe reasoning here is to track all path terminations: esp. for debugging or visualising a persistent process tree (with or without full MoKlee integration) it is helpful to know the exact reason (
StateTerminationType) why a path terminated.Thank you for contributing to KLEE. We are looking forward to reviewing your PR. However, given the small number of active reviewers and our limited time, it might take a while to do so. We aim to get back to each PR within one month, and often do so within one week.
To help expedite the review please ensure the following, by adding an "x" for each completed item: