Repository navigation
E4b: --max-failures, each failure past the failing checks before it - #96
Merged
Merged
Conversation
…ps, and name an unmeasured loop beside a failure.
… proved by unrolling, and beside an unmeasured loop.
…their verdicts rely on so that each is a whole run's verdict.
…se that is executable.
…h its counterexample and backend.
…solving each after the first past the earlier failures.
…firm a failure after a loop past the checks that fail before it.
…sing the earlier failures reaches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A function reported only its first failing check, so each fix showed the next bug one run later.
--max-failures=Nnow reports the firstNfailing checks of each function (0: every one), each with its own counterexample and notes:On the base (#95),
--max-failuresis an unknown option.A check after a failure is reported only when an execution that passes the failing checks before it fails it. This is Boogie's subsumption, which assumes an assertion once it has checked it, and it is why Dafny's list of failing assertions has no duplicates. Solved alone, the overflow above divided by
y = 0, an execution that never reaches the addition. A check that fails only where an earlier one fails is a consequence of that bug, and fixing it fixes both.The confirmation of a failure after a loop (#94) solves its unrolled copies the same way. That corrects a note #94 got wrong:
The failed check is the overflow of
INT_MIN / -1, atc == 2. On the base, the note said that an execution fails it within 3 iterations, but that execution divides by1 - 1in iteration 2. Now:Stacked on #95. This is the second half of plan item E4 (G6: every failing obligation reported).
Design
verifyObligationsis given a number of failures to report, it solves each obligation after the first failure in the executions that pass every earlier obligation that fails.verifyPastEarlierdoes this: it conjoins the obligation's counterexample query with the goals of those obligations, and caches nothing, since that query asks less than the obligation.Nth failure. A parallel run solves every obligation alone, then solves each failure after the first again, in order.VerifyResult::MoreFailures, with the module's backend name). The driver prints each one after it with its own notes, including the loop notes and the confirmation, because a later failure through a loop has the same caveat as the first. These diagnostics are markedAdditional, and the summary does not count them: it still counts functions. JSON has one record per failure.--backend=z3, the default, and source verification. It is an error with the other backends and with archive replay.Tests
suite/max_failures.cpp(new):--max-failures=2and0, each with one job and with four: three failures of one function in the order an execution meets them, with every counterexample after the division dividing by aythat is not zero;suite/inductive_counterexamples.cpp:two_kindsnow gets the note that names the division by zero;past_failurehas a copy that fails within 4 iterations, past a second division that fails in the first iteration. Solved alone, the copy failed within 2 iterations through that division.Each mutant below, applied alone, makes one of the two tests fail:
X2 survived the first run. A serial run stops after
Nfailures, so only a parallel run reaches the cap, and the test now runs--max-failures=2with four jobs.Docs
--max-failures, with a checked example.Checked
clang/test/Verifyon this branch: 482 passed, 1 unsupported (darwin only), and 1 failure,max_failures.cpp, which was extended during the run. On the final build it passes, as doinductive_counterexamples.cpp,function_filter.cpp,inductive_rules.cpp,command_line.cpp,docs_examples.test, anddocs_coverage.test.