Repository navigation
Add the formal verification from formalver (v1.1.0) #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gabehamilton
wants to merge
3
commits into
main
Choose a base branch
from
gabehamilton/formal-verification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
8e68f2a
verification: copy the formal verification from formalver
gabehamilton 03b57d7
verification: correct the README and point the docs at verification/ …
gabehamilton 872218c
verification: note that the Kani record does not match at verification/
gabehamilton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Formal verification (copied from formalver) | ||
|
|
||
| This directory is a verbatim copy of the shared-pool-controls verification from | ||
| [difflabai/formalver](https://github.com/difflabai/formalver), taken at commit `da343e2` | ||
| (formalver PR #32, which is stacked on PR #31 at `651852b`). It verifies contract **v1.1.0**, this | ||
| repository's commit `57b3f02`. No file under `crates/` has changed between `57b3f02` and `7c11f88`, | ||
| the `main` this branch starts from, so the verified code is the code on `main`. | ||
|
|
||
| The formalver CI run on `da343e2` is green: | ||
| [run 43642798201](https://github.com/difflabai/formalver/actions/runs/43642798201) (18 jobs passed; | ||
| the 4 dispatch-only jobs were skipped). | ||
|
|
||
| ## What is here | ||
|
|
||
| | Path | Contents | | ||
| |---|---| | ||
| | `tla/` | TLA+ models (with the executor model) and TLC configurations | | ||
| | `lean/` | Lean proofs | | ||
| | `prolog/` | Prolog model and checks | | ||
| | `kani/` | Kani harnesses; `kani/local/` is the fingerprinted local record of the 48 large harnesses, and `kani/local/not-run.tsv` lists the 27 large mutants with no Kani result at v1.1.0 | | ||
| | `conformance/` | 216 conformance traces and their replay | | ||
| | `near-tests/`, `sandbox/` | NEAR unit tests and sandbox tests | | ||
| | `status.toml`, `strategy.md` | Claims, findings and the verification strategy | | ||
| | `tools/` | The formalver scripts these layers and the CI workflow call | | ||
| | `ci/shared-pool.yml` | formalver's CI workflow, kept here **inactive** (it is not under `.github/workflows/`) | | ||
|
|
||
| ## Not wired up yet | ||
|
|
||
| The files are unchanged from formalver, so their paths still assume formalver's layout: | ||
|
|
||
| | formalver path | Path in this repository | | ||
| |---|---| | ||
| | `projects/shared-pool/source-mirror/` (a submodule pinned at `57b3f02`) | the repository root | | ||
| | `projects/shared-pool/` | `verification/` | | ||
| | `tools/` | `verification/tools/` | | ||
| | `.github/workflows/shared-pool.yml` | `verification/ci/shared-pool.yml` | | ||
|
|
||
| Nothing here runs in this repository's CI yet, and the root Cargo workspace does not include these | ||
| crates. Follow-ups to make it run here: | ||
|
|
||
| 1. Rewrite the paths above (90 of the copied files refer to `source-mirror`), unless follow-up 2 | ||
| restores formalver's layout. | ||
| 2. Keep the Kani record valid. `tools/scripts/check-kani-record.py` (lines 95-104) fingerprints | ||
| paths under `projects/shared-pool/`, including the `source-mirror` gitlink, so the record does not | ||
| match at `verification/`, and a path rewrite would not fix that. There are two ways to keep it: | ||
| - Restore formalver's layout: `projects/shared-pool/`, with `source-mirror` as a submodule of this | ||
| repository pinned at `57b3f02`. A trial extraction in that layout kept the record's fingerprint. | ||
| - Re-run the 48 large harnesses. The current record took about 7 hours on a 64 GB Mac. | ||
|
|
||
| Either way, replace the submodule pin check (`tools/scripts/check-pin.sh`). Inside this repository, | ||
| any change to the contract makes the record stale. | ||
| 3. Check the verification crates' toolchains against the root `rust-toolchain.toml`. The crates | ||
| (`kani`, `conformance`, `near-tests`, `sandbox` with `sandbox/relay`) already declare their own | ||
| `[workspace]`, so the root workspace leaves them alone. | ||
| 4. Move `ci/shared-pool.yml` into `.github/workflows/`, limited by `paths:` filters (a full run takes | ||
| about 48 minutes), and set `vars.CI_RUNNER` / `vars.KANI_RUNNER` if self-hosted runners are used. | ||
|
|
||
| ## History | ||
|
|
||
| The root `README.md` and `docs/verification-handoff.md` point here as well as to formalver. | ||
| The commit history, review threads and CI runs stay in formalver: PR #31 (v1.0.0 verification) and | ||
| PR #32 (v1.1.0 re-verification). The v1.0.0 findings, their fixes in this repository's PR #4, and the | ||
| regression evidence (fails on v1.0.0, passes on v1.1.0) are recorded in `status.toml` and | ||
| `strategy.md`. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update repository-facing verification links for the local copy. Adding the local verification tree without updating the repository-facing documentation leaves readers directed only to formalver PR #32. In particular,
docs/verification-handoff.mdstill states that this repository holds no proofs itself, which is now false. Add the root README/docs link updates to the PR or explicitly list them as a follow-up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 03b57d7. The root
README.md(both formalver links) anddocs/verification-handoff.mdnow also point toverification/. The handoff no longer says this repository holds no proofs; it says the copy is not yet wired into CI.