Skip to content

Add a weekly Charon update job, and run the LLBC regression in the toolchain job - #4920

Merged
feliperodri merged 1 commit into
model-checking:mainfrom
tautschnig:charon-update-bot
Sep 30, 2026
Merged

feliperodri merged 1 commit into
model-checking:mainfrom
tautschnig:charon-update-bot

Conversation

@tautschnig

Copy link
Copy Markdown
Member

Add a weekly job that tries to move the Charon pin to Charon's latest tag, and make the daily toolchain job also run the LLBC regression.

Context. Charon tags nightly-YYYY.MM.DD almost every day, but nothing noticed the pin drifting: before #4883 it was 2,176 commits behind, and catching up needed a patch for box patterns (removed from nightly Rust) and skipping Charon versions that could no longer be built on current toolchains at all. A weekly attempt would have surfaced each of those changes when it happened.

The Charon job (.github/workflows/charon-update.yml, Wednesdays 04:30 UTC and on demand) runs scripts/charon_update.sh, modelled on the CBMC and toolchain jobs:

  • move the charon submodule to the latest nightly-* tag and run cargo update -p charon;
  • run kani-llbc-regression.sh, which covers everything Charon affects (the LLBC build, the -D warnings build, llbc clippy and the llbc suite); the full kani-regression.sh doesn't build Charon, so it isn't needed here;
  • if that passes, open a charon-<tag> PR listing the merged Charon PRs since the current pin; the PR gets the full CI, including cargo deny for new licenses or git sources;
  • if it fails, file an "Automatic Charon upgrade failed" issue, or comment on it if one is open. Charon's tag changes nearly every day while a failure typically lasts for weeks, so this is one rolling issue rather than the one-issue-per-version scheme of the CBMC and toolchain jobs, which would file a new issue every week. A tag the open issue already mentions is not retried; an existing charon-<tag> branch also stops the job.

Most failures will need a person (printer changes break expected files, AST renames need code changes), so in practice this is often an early-warning issue with the Charon log attached rather than a ready-to-merge PR.

The toolchain job now runs kani-llbc-regression.sh after kani-regression.sh, since the latter does not build the LLBC backend: a toolchain that only breaks it (as the box-pattern removal did) went unnoticed until the PR's LLBC job.

Manual testing (the workflow itself only runs on model-checking/kani, so I tested the script):

  • Pin already at the latest tag (nightly-2026.09.29): next_step=none.
  • Pin moved back to nightly-2026.09.26 in a test commit: the script moved it to nightly-2026.09.29, kani-llbc-regression.sh passed (llbc 22/22), next_step=create_pr, and the log section lists the merged PR with a comparison link.
  • With a stubbed failing kani-llbc-regression.sh and a mocked gh: no open issue gives create_issue; an open issue that doesn't mention the tag gives comment_issue; one that does gives none.
  • Fetching the new tag into a depth-1 clone (as the setup action leaves the submodule) gives the full first-parent log and a working checkout.
  • The exact-title issue lookup finds a real issue (Toolchain upgrade to nightly-2026-09-24 failed #4866) when given its title.
  • shellcheck is clean on the new script and actionlint on both workflows.

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

…olchain job

Charon tags `nightly-YYYY.MM.DD` almost daily, but nothing noticed the pin
drifting: before model-checking#4883 it was 2,176 commits behind, and catching up needed a
patch for `box` patterns removed from nightly Rust and skipping Charon
versions that could no longer be built at all.

`charon-update.yml` (weekly, and on demand) runs the new
`scripts/charon_update.sh`, modelled on the CBMC and toolchain jobs. It moves
the `charon` submodule to the latest tag, runs `cargo update -p charon`, and
runs `kani-llbc-regression.sh`, which covers everything Charon affects (the
LLBC build, the `-D warnings` build, llbc clippy and the llbc suite). If that
passes, the job opens a PR that lists the merged Charon PRs; the PR then
gets the full CI, including `cargo deny`. If it fails, the job files an
"Automatic Charon upgrade failed" issue, or comments on it when one is
already open. Because the tag changes nearly every day, a single rolling
issue takes the place of one issue per version; a tag the issue already
mentions is not retried.

`toolchain_update.sh` now also runs `kani-llbc-regression.sh`: the LLBC
backend (and with it Charon) is not built by `kani-regression.sh`, so a
toolchain that only breaks it went unnoticed until the PR's LLBC job.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig
tautschnig requested review from a team as code owners September 30, 2026 07:41
Copilot AI balanced review requested due to automatic review settings September 30, 2026 07:41

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.

Copilot review overview

🟡 Changes recommended

The LLBC update gates can accept failed Kani processes because expected-mode tests ignore their exit status.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds automated weekly Charon updates and expands toolchain-upgrade validation to include the LLBC backend.

Changes:

  • Adds Charon update, regression, PR, and failure-issue automation.
  • Runs LLBC regression during toolchain upgrades.
File Description
.github/​workflows/​charon-update.yml Defines the weekly update workflow.
scripts/​charon_update.sh Implements Charon update and reporting logic.
scripts/​toolchain_update.sh Adds LLBC regression to toolchain validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/charon_update.sh
Comment thread scripts/toolchain_update.sh
@feliperodri
feliperodri added this pull request to the merge queue Sep 30, 2026
Merged via the queue into model-checking:main with commit 986e651 Sep 30, 2026
33 checks passed
srivatsansamraj pushed a commit to srivatsansamraj/kani that referenced this pull request Sep 30, 2026
…odel (model-checking#4924)

With `-Z lean`, stop once the compiler has run instead of trying to link
a goto model that the LLBC backend never writes.

**The bug.** `kani-compiler` translates to LLBC under `-Z lean` and
writes no goto program, but the driver still went on to link one for
every harness. Every `kani file.rs -Zlean --print-llbc` therefore
printed the LLBC and then ended with

```
error: Failed to canonicalize harness model .../test__...main.symtab.out: No such file or directory (os error 2)
```

and exit status 1, even when the translation had succeeded. On current
main all 23 `tests/llbc` tests exit with status 1 this way. The llbc
tests only compare output, so nothing noticed, but it also means a real
failure of the LLBC backend cannot be told apart from success by exit
status.

**The fix.** With the LLBC backend there is nothing to link or verify,
so the driver now stops after compilation, as `--only-codegen` does:
`Project::try_new` creates no link jobs, and the standalone, `cargo
kani` and autoharness entry points skip verification. A failing
translation (a compiler panic, or Charon reporting errors) still exits
with an error.

Stopping early must not skip what the driver checks before verification
(both from Copilot's review): the LLBC path still runs
`determine_targets`, so a `--harness` filter that matches nothing (or a
missing one under `--exact`) is still an error, and `--export-json` and
`--sarif` are rejected with `-Z lean`, as they are with
`--only-codegen`, since nothing would write the requested file.

**Manual testing.**
- `kani tests/llbc/basic0/test.rs -Zlean --print-llbc` prints the LLBC
and exits 0 (was 1 with the error above).
- A program that makes the LLBC translation panic still exits 1.
- `kani -Z lean --harness typo` (also with `--exact`) and `cargo kani -Z
lean --harness typo` fail with "Failed to match the following
harness(es)"; a matching `--harness` succeeds. `-Z lean` with
`--export-json` or `--sarif` is rejected as a conflict; the argument
tests cover both.
- All 23 llbc tests exit 0; checked with the compiletest flag from
model-checking#4925.
- `cargo test -p kani-driver` passes (105/105); the `expected` (487
passed, 0 failed) and `ui` (152/152) suites and
`kani-llbc-regression.sh` pass; fmt and both CI clippy invocations are
clean.

model-checking#4925 makes `kani-llbc-regression.sh` check exit statuses, which is what
Copilot pointed out on model-checking#4920; it is stacked on this one.

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

---------

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
srivatsansamraj pushed a commit to srivatsansamraj/kani that referenced this pull request Sep 30, 2026
…cking#4925)

**Stacked on model-checking#4924**: the first two commits are model-checking#4924 and drop out once
it merges; only the last commit (`e251cab38`) is new here.

Make `kani-llbc-regression.sh` fail an llbc test whose Kani invocation
exits unsuccessfully, not only one whose output misses the expected
lines.

**Context.** Copilot pointed this out on model-checking#4920
([1](model-checking#4920 (comment)),
[2](model-checking#4920 (comment))):
compiletest's `expected` mode (`run_expected_test`) only checks that the
output contains the expected lines and ignores the exit status. That is
what many `expected` tests need, since they pin the output of a failing
verification. For the llbc suite it means a Kani run that prints the
expected LLBC and then fails (Charon reporting errors, a driver error)
still passes. `kani-llbc-regression.sh` is what CI's LLBC job runs, and
what the toolchain and Charon update jobs in model-checking#4920 use to decide between
a PR and an issue.

**The change.** A new opt-in compiletest flag, `--require-success`,
additionally fails an `expected` test whose Kani invocation exits
unsuccessfully. `kani-llbc-regression.sh` passes it for the llbc suite.
Other suites are unchanged.

**Manual testing.**
- Without model-checking#4924's fix, `--require-success` fails all 23 llbc tests (they
all exit 1), while without the flag all 23 pass: the flag catches what
the suite used to miss.
- With model-checking#4924, all 23 pass with `--require-success`, and
`kani-llbc-regression.sh` passes.
- fmt and both CI clippy invocations are clean.

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

---------

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants