Skip to content

[WIP] Try a K frontend that loads claims faster (k#4943) - #2883

Draft
RaoulSchaffranek wants to merge 1 commit into
masterfrom
raoul/kprove-spec-steps
Draft

RaoulSchaffranek wants to merge 1 commit into
masterfrom
raoul/kprove-spec-steps

Conversation

@RaoulSchaffranek

Copy link
Copy Markdown
Member

Work in progress. Not ready for review. This draft tries a K change (runtimeverification/k#4943) in KEVM's CI. It should not be merged as is: it pins K to a branch commit, not to a release.

What is slow

Before kevm prove can prove anything in a spec file, it loads the claims with kprove --dry-run --emit-json-spec. This takes 18–37 s per spec file (median 24 s), about 4,000 s over the 159 spec files of the proof suites. Most of it is spent in K's specification steps. They are applied to the spec module and to the whole KEVM semantics it imports, and the result for the semantics is then discarded.

What this changes

runtimeverification/k#4943 applies those steps only to the spec's own modules. This PR uses that K:

  • flake.nix, flake.lock: k-framework points at the K commit instead of v7.1.337.
  • deps/k_frontend_rev (new): the same K commit. The CI Docker image is still built from the K release in deps/k_release. The Dockerfile now builds the k-frontend jar from this commit and puts it in place of the release's jar. The K change is only in the Java frontend, and the commit is based on v7.1.337, so the rest of the release stays valid.

The Python side does not change (kframework==7.1.337).

What was checked

All on one machine, outside CI:

  • For all 159 spec files of the 7 proof suites, the patched kprove emits the same claims as the unpatched one: byte-identical for 138, the same claims in a different order for 21 (unpatched kprove already varies in claim order between runs).
  • Time per spec file for kprove --dry-run --emit-json-spec, sequential runs on 8 cores at a load average of 3–5: about 35–48 s before and 12–18 s after, on benchmarks/address00, erc20/ds/approve-success, mcd/dai-adduu-fail-rough, functional/lemmas and benchmarks/functional. Details are in [WIP] kprove: apply the specification steps only to the spec's own modules k#4943.

Still open

  • The Docker overlay of the k-frontend jar has not been run yet. This PR's CI is its first test.
  • The proof suites have not been run with this K yet. Proof results should not change, since the claims are the same.
  • Before merging, K needs a release with the change, and this PR then only bumps deps/k_release as usual.

🤖 Generated with Claude Code

…nch raoul/kprove-spec-steps)

The K branch makes kprove apply the specification steps only to the spec's
own modules, which shortens `kprove --dry-run --emit-json-spec` (claim
loading in `kevm prove`).

- flake.nix, flake.lock: k-framework at that K commit.
- deps/k_frontend_rev: the K commit whose k-frontend jar the CI Docker image
  uses. The image is still based on the K release in deps/k_release; only
  the k-frontend jar is rebuilt from the commit and swapped in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant