Skip to content

Accept source-built CBMC versions in the schema-validation test - #5198

Merged
feliperodri merged 2 commits into
model-checking:mainfrom
feliperodri:fix-cbmc-latest-version-check
Nov 20, 2026
Merged

feliperodri merged 2 commits into
model-checking:mainfrom
feliperodri:fix-cbmc-latest-version-check

Conversation

@feliperodri

Copy link
Copy Markdown
Member

The nightly CBMC Latest workflow has failed every night since 2026-10-22. This PR fixes the first of its two failures.

json-handler/schema-validation checks that tools.cbmc in the --export-json output matches \d+\.\d+\.\d+ \(cbmc- (added in #4941). That only matches release builds (6.11.0 (cbmc-6.11.0)). The nightly job builds CBMC from a shallow actions/checkout with no tags, so cbmc --version reports the bare git revision (6.11.0 (8fcda333)), and the check fails. Kani records the --version output verbatim; only the test assumed the format. The check now also accepts a hex revision (optionally -dirty).

The second failure is unrelated to this PR: since 2026-11-06, ~20 expected/loop-contract tests fail because of diffblue/cbmc#9185 ("only variables declared inside a loop are loop locals"). Kani declares every MIR local at function entry, so loop-body temporaries in loops with an explicit loop_modifies clause are now checked against the clause (Check that var_N is assignable). That needs a Kani change and will come in a separate PR. Because kani-regression.sh stops at the first failing suite, the loop-contract failure has hidden this one since 2026-11-06.

Testing

Ran tests/json-handler/schema-validation/test.sh:

  • with a cbmc wrapper that reports 6.11.0 (8fcda333) (the CI format): fails before this change, passes after;
  • with release CBMC 6.11.0: passes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

The check on `tools.cbmc` added in model-checking#4941 requires CBMC's release format,
`6.11.0 (cbmc-6.11.0)`. A CBMC built from a shallow checkout without tags
reports its git revision instead, e.g. `6.11.0 (8fcda333)`, which is what
the nightly CBMC-latest job builds, so json-handler/schema-validation has
failed in that job every night since 2026-10-22. Kani records the
`cbmc --version` output verbatim; only the test assumed the format.

Accept a hex revision (optionally `-dirty`) as well as the release format.

Signed-off-by: Felipe Monteiro <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test-only CBMC version-format update has no active review issues.

No open issues 🎉

What changed in this PR

Updates Kani’s JSON export schema-validation test to accept source-built CBMC version strings used by the nightly CBMC Latest workflow. Production behavior is unchanged.

Changes:

  • Accept hexadecimal revisions with an optional -dirty suffix while retaining support for release versions.
  • Clarify release and source-build version formats in comments.
File Description
tests/​json-handler/​schema-validation/​test.sh Broadens the CBMC version check and documents the accepted formats.

Review effort: Balanced

@feliperodri feliperodri added the [I] CI / Infrastructure Work done to CI, tests and infrastructure. label Nov 19, 2026
@feliperodri feliperodri self-assigned this Nov 19, 2026
@feliperodri
feliperodri added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@feliperodri
feliperodri added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@feliperodri
feliperodri added this pull request to the merge queue Nov 20, 2026
Merged via the queue into model-checking:main with commit 98c3cd8 Nov 20, 2026
32 of 33 checks passed
@feliperodri
feliperodri deleted the fix-cbmc-latest-version-check branch November 20, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[I] CI / Infrastructure Work done to CI, tests and infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants