Count verification goals with the predicate that matches the check mode - #7
Count verification goals with the predicate that matches the check mode#7repowazdogz-droid wants to merge 2 commits into
Conversation
`verifyCommand` computed the pass count, the fail count and the exit code with `VCResult.isSuccess`/`isNotSuccess` in every mode. Those require the validity check to have returned unsat, and `--check-mode bugFinding` runs the satisfiability check only, so a correct program reported "0 goals passed, N failed" and exited 2. Select the predicate from `opts.checkMode`: `bugFinding` uses `isBugFindingSuccess`/`isBugFindingFailure`, everything else keeps `isSuccess`/`isNotSuccess`. `bugFindingAssumingCompleteSpec` is deliberately left on the deductive predicates, because any counterexample is an error in that mode and the bug-finding predicates would report it as a pass. Requires the matching Strata change to `VCOutcome.label`/`emoji`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pass and fail predicates a check mode supplies are independent, not complements. `bugFinding` uses `isBugFindingSuccess`/`isBugFindingFailure`, and a goal whose satisfiability check comes back `unknown`, times out, or fails to encode satisfies neither, so counting only passes and failures dropped it from a line that carries no total. A seven-goal run of a correct program printed "Finished with 4 goals passed, 0 failed." Count that remainder as a third bucket and report it, with the goal total, when it is non-empty. `deductive` and `bugFindingAssumingCompleteSpec` supply complementary predicates, so the bucket is empty and their output is unchanged. Bucketing moves into `countGoals`, which counts the remainder positively rather than as `size - passed - failed`, so that overlapping predicates would show up as a total exceeding the goal count instead of being truncated away by `Nat` subtraction. `#guard`s pin that bucketing never drops or double-counts a goal, and pin which of the two `bugFinding` predicates holds in each of the nine satisfiability/validity cells of docs/VerificationModes.md, including the two cells that satisfy neither. Exit codes are unchanged. An undecided goal is inconclusive, which AGENTS.md records as exit 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
e9b14c1 to
04777bc
Compare
|
I pushed the undecided-goal counter and requested review on 1 August, so this is a note that I am still around for it rather than a nudge. The branch is behind If there is anything you would like changed before review, say so and I will pick it up. |
|
Hey thank you very much for your help in setting things right and ensuring reporting is consistent and helpful. I agree we need to do something. pass / fail / unknown is something relevant for the deductive analysis (and most of the time it's only pass / unknown unless we can prove that there is a true counter-example) So, "✅ no definite bug" could be misleading. Please refer to the classification of the icons we used for VCOutcome to be consistent. When doing bug finding, instead of summarizing the results with pass / fail / unknown, I think we should summarize them with bugs founds / satisfiable and reachable / unknown. |
|
Thanks. I agree, and I will switch the non-deductive One correction before I start, because a CLI-only change will not fully cover what you flagged. Three boundary questions before I write anything. I have stated what I would do by default, so you can correct only the ones you disagree with. Names below are the predicates in
Separately, on the CI here. Both failing jobs are a pre-existing build break rather than anything in this branch. I put the fix up separately as #8. It is a three-line I can implement the vocabulary change as soon as the three questions above are settled. The bucket counting added in this PR carries over without rework: the buckets and the guards that pin the total stay as they are, and only the labels and the choice of which predicate feeds which bucket change. |
Count verification goals with the predicate that matches the check mode
Repository:
strata-org/Strata-CLIBranch:
fix/bugfinding-reportingBase commit:
2fbbdfc(rebased ontomain)Companion change in
strata-org/Strata, branchfix/bugfinding-reporting, which fixes the per-goal labels. This PR fixes the counts and the exit code. Neither is complete alone.What I ran
A Core program that charges
kagainst a meter capped at 100 and assertsmeter <= 100, verified in each of the three check modes. Full reproduction and the second, deliberately racy, program are in the Strata PR.Observed, before the change
Expected: exit 0 and no failures. The program is correct,
--check-mode deductiveproves all seven goals on the same commit, anddocs/VerificationModes.md:11in the Strata repository statesRoot cause
StrataMainLib.lean:643and:649-650:with the exit code driven by
!r.isSuccessat:654.VCResult.isSuccessreduces toVCOutcome.isPass, which requires the validity query to have returned unsat.--check-mode bugFindingruns the satisfiability query only, soisPassis false on every goal regardless of the program,isNotSuccessis true on every goal, and the exit code is 2 whatever was verified.VCResult.isBugFindingSuccessandisBugFindingFailureexist for this atStrata/Languages/Core/Verifier.lean:1316-1324, referenced fromStrata/Transform/CoreSpecification.lean:398and from nothing in the reporting path.Fix
Select the predicate from
opts.checkMode:bugFindingAssumingCompleteSpecstays on the deductive predicates on purpose. Any counterexample is an error in that mode,isSuccessalready expresses it, andisBugFindingSuccessdoes not: routing that mode through the bug-finding predicates reports a real violation as a pass with exit 0. A first version of this patch matched on| _ =>and did exactly that to the racy program from the Strata PR, turning exit 2 into exit 0.Failure and exit are now driven by
goalFailedrather than by the negation of success, so a goal that is neither a definite bug nor a proven pass no longer forces a non-zero exit.Result
Deductive mode is unchanged on both the correct and the racy program,
All 7 goals passedwith exit 0 and0 goals passed, 1 failedwith exit 2 respectively.bugFindingAssumingCompleteSpecis unchanged on both, including exit 2 on the racy program.lake buildsucceeds, 568 jobs, on macOS 15.7.3 arm64 with Lean 4.29.1.Second commit: reporting the undecided goals
The note below said the pass and fail counts no longer sum to the goal total,
and offered to report the remainder.
e9b14c1does that.bugFindinghas three outcome categories rather than two.docs/VerificationModes.mdclassifies the nine satisfiability/validity cellsper mode, and its
bugFindingcolumn readspasson two cells,erroronthree, and
noteon four. The two counters mapped those nine cells onto twobuckets, so the four
notecells were split:(sat, sat)and(sat, unknown)were counted as passed, while
(unknown, sat)and(unknown, unknown)matchedneither predicate and were counted in neither place. Outer
.errorresults,which is where a solver timeout or an encoding failure lands, matched neither
either.
Counting the remainder as a third bucket:
The bucketing moved into
countGoals, which counts the remainder positivelyrather than as
size - passed - failed. The two forms agree on every input anycurrent mode produces, because the predicates each mode supplies are disjoint.
They differ if a future mode ever supplies overlapping predicates: the
subtraction truncates at zero under
Natand silently loses goals, while thefilter makes the total exceed the goal count where a guard can see it.
#guards pin the bucketing invariant and the nine cells, including the twothat satisfy neither
bugFindingpredicate. I checked that they are notvacuous by breaking each one and confirming the build goes red: asserting that
(unknown, unknown)is abugFindingSuccessfails, and so does substitutingthe subtraction form of
countGoals.What I ran for this commit
Twenty-seven combinations, three programs by three check modes by three check
levels, comparing the summary line and the exit code before and against the
change on the same tree.
deductivebugFindingAssumingCompleteSpecbugFindingThe three that changed are the runs with undecided goals, and each now sums to
the goal count:
No exit code changed in any of the twenty-seven. An undecided goal is
inconclusive, which
AGENTS.mdrecords as exit 0.Verified on
2fbbdfc, which this branch is now rebased onto, with dependenciesresolved by
lake updateaslake-manifest.jsondeclares them (inputRev: main). The rebased tree is byte-identical to the tree those runs were madeagainst. The Strata revision used was upstream
main, which does not contain#1448, so the counts here are correct without the companion change. The per-goal
labels still need it.
Building against the committed
revpins rather thaninputRevfails, but thatis not specific to this branch:
mainfails the same way, with the same errors,and its own Build run on 2026-07-29 is red for that reason.
fix/cli-manifest-pinis the fix for it and is deliberately not folded in here.
Companion PR: strata-org/Strata#1448