RFC: Structured verification results (export-json) - #4727
Open
ivmat wants to merge 2 commits into
Open
Conversation
Proposes an opt-in, -Z-gated --export-json <path> flag writing one machine-readable file per verification run: per-harness status, failed properties, check and cover outcomes bucketed exhaustively by status, the warnings CBMC tags as such, and the provenance needed to reproduce the run. Anchored on issue model-checking#942, which has requested exactly this document since 2022. The schema example is genuine output of the proof-of-concept implementation; the vacuity motivating case (a contradictory assume reporting SUCCESSFUL) is shown end to end.
Contributor
Author
|
sorry for spamming, but this would help a lot with automatization and it seems previous PR stalled |
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.
RFC for
--export-json <path>— an opt-in,-Z-gated flag that writes one machine-readable file describing a verification run: per-harness status, failed properties, cover and check outcomes, and the provenance needed to reproduce the run.Why. Today the only way a program can read Kani's results is to grep rendered text for
VERIFICATION:-,** N of M cover properties satisfied, andVerification Time:. Those are printing details, not an interface — when they change, a consumer's grep silently matches nothing.The specific gap: a proof can pass while proving nothing, and no machine-readable signal says so. A contradictory
kani::assumemakes every assertion unreachable; the harness reportsVERIFICATION:- SUCCESSFULand exits 0. Kani's text output says** 0 of 2 failed (2 unreachable)— a program reading the exit code sees a clean proof. This RFC's schema makes that distinction, and the vacuity ones like it, machine-readable.Why not
--sarif. SARIF is findings-shaped: Kani's writer skips cover properties and emits nothing for successful ones, so a fully green run produces an emptyresultsarray. Proof, cover and vacuity semantics would have to live inpropertiesbags — a private schema wearing a standard schema's clothes — and--sarifmust stay valid SARIF while this artifact must be free to change shape under-Z. One file cannot be both.Relation to #4472. @yimingyinqwqq proposed this capability there and did substantial work; the design discussion on that PR shaped this proposal, and I'd genuinely welcome their review. This RFC takes
0016rather than0015to leave that PR's number with it. Written RFC-first because that is what reviewers asked for on #4472.Status. Implemented as a proof of concept; the schema example in the RFC is real output. Happy to open the implementation PR alongside, or keep this standalone — whichever you prefer.
What is deliberately excluded, and why
getrusage(RUSAGE_CHILDREN)and rejected:ru_maxrssis a process-wide running maximum, so any figure is order-dependent (only a harness that out-peaks all its predecessors gets one) and meaningless under--jobs. Honest measurement needs per-child accounting (wait4()-based rusage or a per-child cgroup) — future work, sketched in the RFC. CI consumers infer OOM from exit code 137 today.-Zwith an explicitschema_versionuntil real consumers have exercised it.Open questions I'd like input on
schemarsdependency, which is not currently in the workspace — a real dependency decision rather than something to slip in.autoharnesssubcommand, or is that a follow-up once the harness-level shape settles?--coverage) — include here, or leave in their existing artifact? (Todaycode_coverageproperties are outsidechecks/coversand outsiden_properties, so the partition invariant holds; a dedicated bucket is the alternative.)configurationnow recordsassertion_reach_checks,ignore_global_asmandextra_pointer_checks— the soundness-relevant toggles we identified. What other options merit the same treatment, and should there be an explicit policy for when a flag must be recorded?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.