Repository navigation
Fix the macOS flake of confirmation_invariants.cpp: fail its invariant where any memory is a model - #115
Merged
Conversation
…y memory is a model.
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.
confirmation_invariants.cppfailed on the macOS runners of #105 and #110 (2 of 5 macOS runs today):bounded_copy, whose loop invarianti <= 8is not inductive, endedUnresolved [solver.timeout]after 21 s instead of failing at once. Neither PR touches the test or the solver; the same commit passed on the other runners.Why
The failing check's query assumes the second invariant,
forall j in [0, i). out[j] == a[j], and the loop's heap frame. Ati = 8a counterexample needs a memory in which eight elements are copied, which Z3's model search finds or not depending on its search order. On Linux the search order changes with the variables' names, which reproduces it: of 40 renamings of the test's variables, 2 took the whole 20 s budget and the mean was 4.2 s.The fix
The invariant fails at
i = 0instead (i <= 0), where the quantified invariant ranges over no element, so any memory is a model. Of the same 40 renamings, none took more than 0.20 s. The budget goes back from 20 s to 5 s, which #104 raised for this failure.The test still checks what it is for, the early end of the search for an execution that fails a dropped invariant: with that end removed (
if (Bound >= 1 && !Unrolled) return Notes;deleted), the confirmation takes 5.2 s at--timeout=5000, and the test's check that it takes under a second fails.