Repository navigation
Conversation
Synchronize required K files by content before recompilation. Repair stale copies even when source digests match, and invalidate partial compiler success before retries. Preserve caching for Solidity-only changes. Add filesystem regressions and a compiled-lemma integration test. Fixes runtimeverification#871
Keep interrupted stale-copy repairs from reusing an old compiled definition. Invalidate before updating the copied source, remove the transient change flag, and add a failed-generation retry regression.
anvacaru
left a comment
There was a problem hiding this comment.
I confirmed that 6/8 unit tests fail against the master's kompile.py. A few suggestions:
test_foundry_kompile_failed_retry[source-edit]is redundant: with a source edit, the digest mismatch forces a rekompile on retry regardless of theexceptcleanup, so only the internaltimestamp.exists()assertion distinguishes it. Thestale-copyvariant is the one that actually exercises the cleanup, so I'd keep only that one.- The "rekompiles with a fresh copy" cases (
updated_lemma,stale_copy,missing_copy) share the same shape and could be one@pytest.mark.parametrizetable. Same for the "does not rekompile" cases (unchanged_lemma,contract_digest_change). That also makes adding a case a one-line change. contract_digest_changecovers behavior that already existed and is also checked by the last step of the integration test. Perhaps it could fold into the "does not recompile" group above.
Parameterize fresh-copy and cache-hit scenarios, retaining stale-copy failure cleanup and generation retries. Drop the redundant source-edit retry case and use the current K symbol attribute.
|
Thanks for the review, @anvacaru. Commit
The post-review delta changes only the two test files. Static review found no regressions in the retained assertions, and both files passed Python syntax checks. There are now seven required-lemma unit cases. For clarity, the detailed validation in the PR description belongs to Could a maintainer approve both workflows for current head
Both report |
Fixes #871.
Editing a K file supplied through
--requirecould trigger recompilation while leaving its previous copy inout/kompiled/requires, so the rebuilt definition still used old lemmas. Compare the required source files and their copies by content, and refresh missing or changed copies before regeneration and recompilation.Invalidate the compiled-success timestamp before repairing required-file copies and before compilation. Remove it after failed or interrupted compilation, including when one backend has already completed, so retries rebuild. Preserve caching for unchanged inputs and Solidity-only changes. Only print the
--regenmessage when that option was explicitly requested.Add unit regressions for content changes with preserved source mtimes, stale and missing copies, unchanged inputs, generation and compilation failures followed by retries, and contract-digest changes. The integration regression compiles a lemma that evaluates to
0, edits it to evaluate to1, and checks the new result without--regenor--rekompile. It also checks that unchanged and Solidity-only builds reuse the compiled definition.Current validation for head
826e4c7ab176e4f03bad0f58c306e39706751387(October 8, 2026):symbol(lemmaValue), parametrized fresh-copy and cache cases, and removal of the redundant source-edit retry while retaining stale-copy failure/retry and generation retry.masterinto the branch. The three files belonging to this PR are unchanged from15b21d43; the additional changes in the historical comparison are upstream changes brought in by the merge.test_foundry_kompile_updated_lemmapassing with real compilation and Kore simplification.zizmorandactionlint).3196d45be44087f3407f97d29f79394966e54a06, which merges this head into base1649663e7eaed4375fa674b9489875c074486e5f.git diff --checkpassed. No additional source changes were made during this review.The earlier workflow-approval blocker is resolved, and MacM1 Nix build/smoke validation has now passed in upstream CI. The results below are retained historical local validation for
99aa7e81.Historical local validation at 99aa7e8
make checkandmake pyupgrade: passed;pyupgrademade no changes.make test-unit: 99 passed, including all 8 required-lemma regression cases.75bb958dfails at the expected assertion: the edited lemma still evaluates to0instead of1.Identity.applyOp(uint256)andPreconditionTest.testPrecondition(uint256), logged SMT solver timeouts.--no-deps, and installed-wheel CLI smoke: passed (--help, version, build, prove, show, and list), using prepared runtime dependencies and precompiled definitions. The freshAssertTest.test_assert_true()proof passed with no pending or failing nodes. Installed package files match the PR sources.forge build,kontrol build -O2,kontrol prove, andkontrol show;kontrol listalso passed. The freshAssertTest.test_assert_true()proof passed with 5 nodes, no pending, failing, or vacuous nodes, andadmitted=false.eth-abi 6.0.0, compared with5.2.0in the locked full-suite environment. Only isolated test tooling (pytest-mock 3.15.1) was added; runtime distribution metadata and installed Kontrol Python source bytes were unchanged. Kontrol imports were verified to come from the installed image package.packages.x86_64-linux.kontrol.solc_0_8_13: build passed with Nix2.31.0and the unchanged flake lock. A freshpackage/test-package.shrun, followed bykontrol showandkontrol list, passed with GNU sed on PATH andFOUNDRY_SOLCselecting the package's Solc0.8.13. The fresh proof passed with 3 nodes, no pending, failing, or vacuous nodes, andadmitted=false. Installed Kontrol package files match the PR sources.git diff --check: passed.The full pytest run and isolated CSE/Precondition reruns used the official
runtimeverificationinc/kontrol:ubuntu-jammy-1.0.255image (linux/amd64, under ARM emulation) with the PR Python sources, dependency versions fromuv.lock, K7.1.337, KEVM1.0.921, Kore RPC0.1.155, Z34.13.4, Forge1.5.1, and Solc0.8.13. KEVM Python sources came from its exact pinned commit archive; the archive's omitted native plugin sources were restored from the same-version image. The image's Kontrol semantic source files were byte-compared with the PR sources before reusing its precompiled definitions. Those runs usedPYTHONHASHSEED=0for consistent worker collection and--force-sequentialas in CI. Branch coverage was collected from the full run and the isolated CSE/minimization run. The separate fresh Docker build installed dependencies through the unmodified Dockerfile and rebuilt the native definitions.Local Nix validation targeted
x86_64-linuxfrom an official ARM Linux Nix container with--extra-platforms x86_64-linux, using Docker's x86 emulation. The initial container smoke failed during K's version check because GNU sed was absent from PATH. After adding sed, Forge's auto-selected SVM compiler failed because its ELF loader was absent from the container; selecting the installed Nix Solc throughFOUNDRY_SOLCallowed the fresh smoke to pass. No source, fixture configuration, package output, or flake lock was edited for these retries. The default native ARM Linux target cannot evaluate because the pinned Solc input does not providesolc_0_8_13for that platform; the Nix files are unchanged from the PR base. Native macOS Nix validation remains unrun locally.