Skip to content

Replace negate_success with success + failure verdict gates#2

Merged
Yiannis128 merged 3 commits into
masterfrom
refactor-verdict-patterns
Jul 16, 2026
Merged

Replace negate_success with success + failure verdict gates#2
Yiannis128 merged 3 commits into
masterfrom
refactor-verdict-patterns

Conversation

@Yiannis128

Copy link
Copy Markdown
Collaborator

Removes the negate_success boolean, which silently reinterpreted the success
field as a failure pattern and defaulted fail-open — a failure whose pattern
didn't match was reported as a successful run. That's how the NaN verdict bug hid.

Replaces it with two explicit, nullable patterns layered on a data-driven baseline:

  • baseline — a run passes iff it has no error-severity issue (warnings/info
    never flip the verdict).
  • success (optional, positive, fail-closed) — must match to pass; a crash or
    truncated output with no success line reports failed. Used by esbmc/cbmc.
  • failure (optional, gate) — a match forces failure; covers verifiers whose
    failures don't surface as issues by default (Kani without --trace). Used by
    clang/kani/pytest.

The three are independent gates, so a miss in one is caught by another (a failure
whose pattern was missed is still caught if it produced an error issue, and vice
versa) — closing the fail-open that a single signal left open.

Behaviour is preserved across every regression fixture. Adds parser-level unit tests
for the verdict matrix (data-driven, success fail-closed, failure gate, error-issue
backstop, both patterns).

…ct gates

The `negate_success` boolean silently reinterpreted the `success` field as a
failure pattern and defaulted fail-open — a missed failure pattern reported the
run as successful (how the NaN verdict bug hid). Replace it with two explicit
nullable patterns over a data-driven baseline:

- `success` (positive, fail-closed): must match to pass.
- `failure` (gate): a match forces failure; covers verifiers whose failures do
  not surface as issues by default (e.g. Kani without --trace).
- baseline: a run passes iff it has no error-severity issue; warnings/info never
  flip the verdict.

The three checks are independent gates, so a miss in one is still caught by
another. Migrate specs: esbmc/cbmc keep `success`; clang/kani/pytest move to
`failure` (kani also clears the `success` it inherits from cbmc_spec via replace).
Behaviour preserved across all regression fixtures; adds parser-level verdict
unit tests.
Close the coverage gaps the code review flagged: the clang negate_success ->
failure migration had no test. Add real gcc-produced regression fixtures
(unused_variable_warning -> successful, undeclared_error -> failed) that pin the
"warnings never fail the build" behaviour on real diagnostics, plus verdict unit
cases for info-severity (passes) and mixed warning+error (fails).
…rings

/simplify cleanup. clang's `error:` diagnostic is already extracted as an
error-severity issue, so the data-driven baseline fails the run — the `failure`
pattern was pure redundancy (clang, unlike kani/pytest, has no failure-without-an-
issue mode). Drop it so clang is cleanly data-driven. Also de-duplicate the verdict
invariant that was spelled out in three docstrings down to one authoritative place,
and correct the "gates catch each other" note (only the error-issue baseline and
`failure` are mutually-catching failure signals; `success` is a fail-closed positive
requirement). Behaviour unchanged; all fixtures pass.
@Yiannis128
Yiannis128 merged commit 32eb7b7 into master Jul 16, 2026
2 of 3 checks passed
@Yiannis128
Yiannis128 deleted the refactor-verdict-patterns branch July 16, 2026 22:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant