Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
2d9d9fc
Subtree update automation: do not use `git subtree merge --squash` (#…
tautschnig Apr 1, 2025
7aaa844
Merge subtree update for toolchain nightly-2025-03-18 (#309)
github-actions[bot] Apr 1, 2025
b152f68
Update Kani Metrics (#305)
github-actions[bot] Apr 1, 2025
d2b6a64
Add Challenges 17 18 for slices (#265)
thanhnguyen-aws Apr 3, 2025
9da1baa
Add Challenge 16: Iterator (#260)
thanhnguyen-aws Apr 4, 2025
b327f32
Merge subtree update for toolchain nightly-2025-04-01 (#312)
github-actions[bot] Apr 7, 2025
0acfa26
Update Kani Metrics (#316)
github-actions[bot] Apr 7, 2025
9500327
Sync the VeriFast proofs and provide guidance on same (#313)
btj Apr 8, 2025
659982c
Merge subtree update for toolchain nightly-2025-04-04 (#318)
github-actions[bot] Apr 9, 2025
0d860d0
Merge subtree update for toolchain nightly-2025-04-06 (#320)
github-actions[bot] Apr 14, 2025
3f4234a
Update Kani Metrics (#322)
github-actions[bot] Apr 14, 2025
8b51d1d
Remove unused subtree update helper scripts (#325)
tautschnig Apr 17, 2025
e33c59d
Subtree update automation: create merge PR even when subtree/library …
tautschnig Apr 17, 2025
3b80a4c
Add script to text-extract all contracts (#323)
tautschnig Apr 17, 2025
649567e
Merge subtree update for toolchain nightly-2025-04-07 (#329)
github-actions[bot] Apr 22, 2025
64af8ce
Update Kani Metrics (#333)
github-actions[bot] Apr 22, 2025
5cf80a8
Merge subtree update for toolchain nightly-2025-04-21 (#336)
github-actions[bot] Apr 22, 2025
75bf5ce
Merge subtree update for toolchain nightly-2025-04-23 (#340)
github-actions[bot] Apr 24, 2025
c28334f
Fix Challenge 18 rendering in book (#337)
Apr 24, 2025
23a9436
Merge subtree update for toolchain nightly-2025-04-24 (#342)
github-actions[bot] Apr 24, 2025
dd017ac
Update Kani Metrics (#343)
github-actions[bot] Apr 28, 2025
ad096af
Add loop_invariants for some Int power functions (#327)
thanhnguyen-aws Apr 28, 2025
29f7a35
Implement kani::Arbitrary for Wrapping, Saturating, and Simd types (#…
Apr 28, 2025
f1aaa87
Add autoharness-analyzer CI job (#344)
tautschnig Apr 28, 2025
f804a33
Add autoharness to run-kani script and use in CI (#334)
tautschnig Apr 29, 2025
0700c36
Update Kani Metrics (#349)
github-actions[bot] May 5, 2025
00f2f8d
Only require two approvals for changes to `doc/`, `library/` or `veri…
May 8, 2025
e0e6e83
Fix typo in comment ('contact' -> 'contract') (#352)
patricklam May 10, 2025
5112f81
Update Kani Metrics (#355)
github-actions[bot] May 11, 2025
a5f6908
Fix num::nonzero::NonZero::<*>::rotate_{left,right} contracts (#346)
tautschnig May 13, 2025
571c8ac
Update Kani Metrics (#359)
github-actions[bot] May 18, 2025
30d156b
Merge subtree update for toolchain nightly-2025-05-06 (#354)
github-actions[bot] May 20, 2025
38f4c41
Parse log file of multi-threaded Kani run (terse output) into JSON (#…
tautschnig May 20, 2025
02a7a8c
Add Challenges 20 21 22 for str Pattern and iter (#266)
thanhnguyen-aws May 20, 2025
c8aeb5b
Add Challenge 25: VecDeque (#269)
thanhnguyen-aws May 21, 2025
d37c183
Add Challenge 19: Safety of RawVec (#314)
thanhnguyen-aws May 21, 2025
07b7465
Add safety preconditions to std/src/alloc.rs (#330)
tautschnig May 21, 2025
9b57573
Challenge 7: make panicking part optional; remove mention of verifyin…
May 22, 2025
1eb9a53
Merge subtree update for toolchain nightly-2025-05-20 (#361)
github-actions[bot] May 22, 2025
9414fee
Move autoharness_analyzer to `scripts/` (#350)
May 22, 2025
13014d9
Add preconditions for disjoint_bitor (#347)
tautschnig May 22, 2025
afb5c2c
Update Kani Metrics (#365)
github-actions[bot] May 25, 2025
b4f59e8
Merge subtree update for toolchain nightly-2025-05-22 (#364)
github-actions[bot] May 28, 2025
c120797
additional transmute and transmute_unchecked harnesses (#264)
AlexLB99 May 30, 2025
81b5eea
Use uname -m instead of uname -p (#372)
patricklam May 30, 2025
e00a6b9
Add missing `proof_for_contract` to `mut_ptr::offset_from` harness (#…
May 30, 2025
dacc2d5
Derive `Arbitrary` for various `core_arch::x86` types (#348)
tautschnig May 30, 2025
111339d
Merge subtree update for toolchain nightly-2025-05-28 (#370)
github-actions[bot] May 30, 2025
7139219
update-subtree action: patch VeriFast proofs (#371)
btj May 30, 2025
354b18e
Free up disk space to ensure successful execution of jobs (#374)
tautschnig Jun 2, 2025
4037b15
Fix subtree update action (#375)
tautschnig Jun 2, 2025
bacd51c
Update Kani Metrics (#376)
github-actions[bot] Jun 2, 2025
4b3883d
Merge subtree update for toolchain nightly-2025-06-02 (#378)
github-actions[bot] Jun 4, 2025
e34a5c6
Setting the appropriate target when running autoharness-analyzer (#384)
vonaka Jun 8, 2025
93325a4
Update Kani Metrics (#385)
github-actions[bot] Jun 8, 2025
0840b22
Kani: use -Z unstable-options instead of --enable-unstable (#386)
tautschnig Jun 9, 2025
731bb1e
Updates for goto-transcoder and ESBMC (#387)
rafaelsamenezes Jun 10, 2025
7dd01bb
Add challenge 23 24 for Vec (#267)
thanhnguyen-aws Jun 10, 2025
79498aa
NonZero (unchecked_mul & unchecked_add) Proof for Contracts (#338)
tautschnig Jun 14, 2025
3600e5d
Update Kani Metrics (#389)
github-actions[bot] Jun 15, 2025
9949c4a
Merge subtree update for toolchain nightly-2025-06-03 (#380)
github-actions[bot] Jun 17, 2025
86005d5
Update Kani Metrics (#393)
github-actions[bot] Jun 23, 2025
26d30a0
Merge subtree update for toolchain nightly-2025-06-17 (#392)
github-actions[bot] Jun 23, 2025
613f27d
Subtree update automation: update submodules (#394)
tautschnig Jun 24, 2025
03aa374
Fix subtree automation for submodules when there were no changes (#396)
tautschnig Jun 26, 2025
94c1dc1
Don't run update-subtree.yml in forks (#400)
btj Jun 28, 2025
e021729
Update Kani Metrics (#402)
github-actions[bot] Jul 3, 2025
8f55686
Update Kani Metrics (#408)
github-actions[bot] Jul 6, 2025
45ed9e9
Merge subtree update for toolchain nightly-2025-07-02 (#407)
github-actions[bot] Jul 9, 2025
a4edf5f
Run more automatic harnesses (use patterns w/ regex support) (#397)
Jul 10, 2025
32115e8
Add safety preconditions to core/src/iter/range.rs (#331)
tautschnig Jul 11, 2025
fca4586
Update Kani Metrics (#415)
github-actions[bot] Jul 14, 2025
1c4ea17
Add contracts for NonZero::from_mut_unchecked (#345)
tautschnig Jul 15, 2025
a914785
Add Flux tool description and CI workflow (#403)
nilehmann Jul 16, 2025
15b5665
Update Kani Metrics (#419)
github-actions[bot] Jul 20, 2025
e4bedab
Simplify Flux contract for int conversion (#416)
nilehmann Jul 22, 2025
c176f19
Update for toolchain nightly-2025-07-10 + Fix loop-invariant (#417)
thanhnguyen-aws Jul 22, 2025
34236a6
Merge subtree update for toolchain nightly-2025-07-14 (#421)
github-actions[bot] Jul 23, 2025
099ad08
align_to and align_to_mut contract and harnesses (#405)
AlexLB99 Jul 24, 2025
e3a6411
Update Kani Metrics (#424)
github-actions[bot] Jul 27, 2025
f56cf20
Fix table in 0025-vecdeque.md (#425)
btj Jul 28, 2025
4c08921
Add missing line breaks in 0020-str-pattern-pt1.md (#426)
btj Jul 28, 2025
71c5bf3
Merge subtree update for toolchain nightly-2025-07-21 (#428)
github-actions[bot] Jul 29, 2025
177d0fd
Merge subtree update for toolchain nightly-2025-07-30 (#432)
github-actions[bot] Jul 30, 2025
cca65d3
Merge subtree update for toolchain nightly-2025-07-31 (#437)
github-actions[bot] Aug 1, 2025
e4dcb19
Update Kani Metrics (#442)
github-actions[bot] Aug 4, 2025
bba1224
LLM-generated contracts for `__iterator_get_unchecked` (#435)
vonaka Aug 6, 2025
ca5f7b8
Merge subtree update for toolchain nightly-2025-08-01 (#441)
github-actions[bot] Aug 6, 2025
8e9f2b7
Update ESBMC link (#448)
rafaelsamenezes Aug 6, 2025
517e11e
Merge subtree update for toolchain nightly-2025-08-06 (#447)
github-actions[bot] Aug 6, 2025
9e522b6
Update Kani Metrics (#454)
github-actions[bot] Aug 10, 2025
cd5e611
New challenges for Rc, Arc, and related Weak implementations (#367)
AlexLB99 Aug 12, 2025
a0fca1c
A bunch of LLM-generated contracts (#451)
vonaka Aug 12, 2025
6dfbad5
ci: only run update-kani-metrics in model-checking/verify-rust-std (#…
zjp-CN Aug 12, 2025
ee499dd
Merge subtree update for toolchain nightly-2025-08-07 (#450)
github-actions[bot] Aug 13, 2025
f140b10
Bump VeriFast to 25.07 (#453)
btj Aug 13, 2025
80da01f
Add Flux to list of approved tools (#455)
tautschnig Aug 13, 2025
f66ba41
VeriFast solution for challenge 19 (RawVec) (#422)
btj Aug 14, 2025
c090506
Merge subtree update for toolchain nightly-2025-08-18 (#467)
github-actions[bot] Aug 19, 2025
c2631f2
Merge subtree update for toolchain nightly-2025-08-19 (#471)
github-actions[bot] Aug 19, 2025
ca49535
Update Kani Metrics (#469)
github-actions[bot] Aug 19, 2025
1231f86
VeriFast solution for Challenge 5 (linked_list.rs) (#238)
btj Aug 20, 2025
2a203c5
Merge subtree update for toolchain nightly-2025-08-20 (#476)
github-actions[bot] Aug 21, 2025
8de7d8f
Update Kani Metrics (#478)
github-actions[bot] Aug 25, 2025
3675c7b
Update Kani Metrics (#483)
github-actions[bot] Sep 9, 2025
4761a01
Workaround sporadic git submodule failure (#484)
tautschnig Sep 9, 2025
047eac5
Challenge 1 status update (#433)
AlexLB99 Sep 9, 2025
13a59e3
Merge subtree update for toolchain nightly-2025-08-26 (#480)
github-actions[bot] Sep 9, 2025
88422c8
Show contest status in repo README (#482)
btj Sep 9, 2025
398ff24
Add Flux specifications to path/bstr/hash/time (#438)
nilehmann Sep 9, 2025
8e3d846
Update Kani Metrics (#492)
github-actions[bot] Sep 14, 2025
9187a7f
README.md: Fix broken links (#495)
btj Sep 24, 2025
af09d6d
Update Kani Metrics (#494)
github-actions[bot] Sep 24, 2025
ffda6a8
Testable Models for SIMD Intrinsics (#423)
karthikbhargavan Sep 24, 2025
7be2745
Update Kani Metrics (#496)
github-actions[bot] Sep 28, 2025
195e1b6
Update Kani Metrics (#497)
github-actions[bot] Oct 5, 2025
53e9e1b
Add and update rewards to open challenges lacking one (#459)
tautschnig Oct 8, 2025
6be9ca4
Remove spurious comments about the need for quantifiers (#457)
tautschnig Oct 8, 2025
b007ef7
Update README.md now that Challenge 1 is resolved (#486)
tautschnig Oct 8, 2025
28ab0a2
Merge subtree update for toolchain nightly-2025-09-09 (#488)
github-actions[bot] Oct 9, 2025
525c2f0
LLM-generated contracts (#473)
vonaka Oct 9, 2025
c0c576a
Add loop invariants and harnesses for DecimalSeq functions (#439)
thanhnguyen-aws Oct 9, 2025
3bb48f0
Add loop_invariant and harness for array reverse (#430)
thanhnguyen-aws Oct 9, 2025
02cd117
Fixup merge resolution: Add and update rewards to open challenges lac…
tautschnig Oct 20, 2025
78e9eb3
Update Kani Metrics (#509)
github-actions[bot] Oct 20, 2025
b5775bd
Clarify documentation of `can_dereference` with write permissions (#510)
dawidl022 Oct 21, 2025
bf0ae0e
Update Kani Metrics (#511)
github-actions[bot] Nov 10, 2025
3ad3d85
Update Kani Metrics (#514)
github-actions[bot] Nov 17, 2025
b22e2fa
Update Kani Metrics (#517)
github-actions[bot] Nov 24, 2025
d673526
Add a tour of the RawVec proof (#481)
btj Nov 27, 2025
3b82716
Update Kani Metrics (#519)
github-actions[bot] Dec 1, 2025
afb1875
Update Kani Metrics (#521)
github-actions[bot] Dec 21, 2025
ac622da
Merge subtree update for toolchain nightly-2025-10-09 (#504)
github-actions[bot] Jan 16, 2026
dd1e82c
Improve the VeriFast scripts (#507)
btj Jan 18, 2026
bb7bdc9
Update Kani Metrics (#522)
github-actions[bot] Jan 18, 2026
c5cfe81
Update Kani Metrics (#534)
github-actions[bot] Jan 26, 2026
9bbdb30
Update Kani Metrics (#536)
github-actions[bot] Feb 2, 2026
18299e0
Update Kani Metrics (#542)
github-actions[bot] Feb 8, 2026
f25c24e
Update Kani Metrics (#548)
github-actions[bot] Feb 16, 2026
3508a8f
Update Kani Metrics (#551)
github-actions[bot] Feb 23, 2026
be3bf0e
Update Kani Metrics (#553)
github-actions[bot] Mar 2, 2026
7056130
New challenge: flt2dec (#523)
AlexLB99 Mar 5, 2026
68525fc
New challenge: safety of boxed (#525)
AlexLB99 Mar 5, 2026
c69b9b9
Use minimal GITHUB_TOKEN permissions for metrics and subtree workflow…
AdnaneKhan Mar 5, 2026
65cf645
Update Kani Metrics (#555)
github-actions[bot] Mar 9, 2026
1f5b4db
README.md: Sync rewards (#515)
btj Mar 9, 2026
7af3f89
Update Kani Metrics (#556)
github-actions[bot] Mar 15, 2026
2840898
Update Kani Metrics (#563)
github-actions[bot] Mar 23, 2026
0b8a9a9
Update Kani Metrics (#579)
github-actions[bot] Mar 29, 2026
314fbd7
Add GitHub Copilot code review instructions (#581)
feliperodri Mar 31, 2026
3840a6f
Update Kani Metrics (#583)
github-actions[bot] Apr 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
84 changes: 84 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Verify Rust Standard Library — Code Review Guidelines

## Purpose & Scope

This repository is a fork of the Rust standard library used exclusively for formal verification. Verification targets include memory safety, undefined behavior, and functional correctness, depending on the specific challenge. PRs fall into four categories: **solving challenges**, **proposing new challenges**, **proposing new tools**, and **maintenance**.

## Approved Verification Tools

Only these tools are accepted: **Kani**, **VeriFast**, **Flux**, and **ESBMC (GOTO-Transcoder)**. Flag any PR that uses a tool not on this list — it must go through a separate tool application process first.

---

## General Rules (All PRs)

- The contribution must be automated and pass as part of PR CI checks. Contributors should maintain the proofs and provide support thoughtout the lifetime of the contest (i.e. keeping it up-to-date with infrastructure changes in the contest).
- Changes must not alter the runtime logic of the standard library unless the change is proposed and incorporated upstream into the official Rust standard library.
- All contributors must be properly credited. By submitting, contributors confirm they can use, modify, copy, and redistribute their contribution.
- PRs should reference the relevant tracking issue (e.g., `Resolves #ISSUE-NUMBER`).
- Merging requires approval from at least two committee members listed in `.github/pull_requests.toml`.

---

## Challenge Solutions (Highest Priority)

These PRs solve open verification challenges. Apply the strictest review criteria:

### Success Criteria Compliance
- Verify the PR meets **every** success criterion listed in the specific challenge description. Partial solutions should be flagged.
- Check the challenge page at `doc/src/challenges/` or the [challenge book](https://model-checking.github.io/verify-rust-std/challenges/) for the exact requirements.

### Formal Verification Rigor
- **No vacuous proofs.** Ensure harnesses and contracts actually exercise the property under verification. A proof that passes trivially (e.g., with an unsatisfiable precondition or an empty harness body) is unacceptable.
- **No unjustified assumptions.** Every `#[kani::assume]`, `requires`, or equivalent precondition must be justified by the function's documented safety contract or API invariants. Flag assumptions that over-constrain inputs to make verification pass.
- **Contracts must reflect documented safety conditions.** Cross-reference preconditions and postconditions against the function's `# Safety` doc comments and the [official std library documentation](https://doc.rust-lang.org/std/).
- **Harnesses must cover meaningful input ranges**, not just trivial or degenerate cases.
- **Verification must actually run in CI** using one of the approved tools. Check that the relevant workflow (kani.yml, verifast.yml, flux.yml, goto-transcoder.yml) executes the new proofs.

### Code Quality for the Rust Standard Library
- Code should be **idiomatic Rust** and match the style of the surrounding standard library code.
- Unsafe code blocks must have a `// SAFETY:` comment explaining why the usage is sound.
- Use `#[inline]` only on public, small, non-generic functions. Do not add `#[inline]` to generic methods or trait methods without default implementations. Avoid `#[inline(always)]` unless justified by benchmarks.
- Contracts and harness code should be **readable and well-documented** so that someone unfamiliar can understand what property is being verified and why.
- Verification annotations (contracts, harnesses, proof attributes) should be clearly separated from the library's functional code using `cfg` attributes (e.g., `#[cfg(kani)]`) so they don't affect normal compilation.
- Do not introduce new public API surface unless the challenge explicitly requires it.

---

## New Challenge Proposals

- Must follow the template at `doc/src/challenge_template.md`.
- Must include a tracking issue created with the challenge issue template.
- Must add an entry in `doc/src/SUMMARY.md`.
- Success criteria must be specific, measurable, and achievable with the currently approved tools.
- Flag vague or overly broad success criteria.

---

## New Tool Applications

- Must be submitted as a separate issue using the "Tool Application" template before any PR using the tool.
- The PR must include a new CI workflow that runs the tool against the standard library.
- The PR must add a new entry to the "Approved Tools" section of the book.

---

## Maintenance PRs

- Repository updates, CI fixes, documentation improvements, and dependency bumps.
- Should not change verification semantics or weaken existing proofs.
- Flag any maintenance PR that removes or weakens existing contracts, harnesses, or proof obligations.

---

## Common Red Flags to Watch For

- Harness with no assertions or only trivial assertions.
- `kani::assume(false)` or preconditions that make the proof vacuously true.
- Assumptions that are stricter than what the function's safety docs require.
- Contracts that don't match the `# Safety` section of the function being verified.
- Verification code that is not gated behind a tool-specific `cfg` (e.g., `#[cfg(kani)]`).
- Changes to `library/` source files that alter runtime behavior without upstream justification.
- Missing or incorrect tracking issue references.
- Use of a verification tool not in the approved list.
- Large, hard-to-review PRs that should be split into smaller logical units.
72 changes: 72 additions & 0 deletions .github/workflows/flux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Flux

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

env:
FLUX_VERSION: "6b080b32801f923bfb590ac48e729de38f829f21"
FIXPOINT_VERSION: "nightly-10-15-2025"

jobs:
check-flux-on-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Local Binaries
run: |
mkdir -p ~/.local/bin
echo ~/.cargo/bin >> $GITHUB_PATH
echo ~/.local/bin >> $GITHUB_PATH

- name: Download and install fixpoint
run: |
set -e
NAME="fixpoint-x86_64-linux-gnu.tar.gz"
URL="https://github.com/ucsd-progsys/liquid-fixpoint/releases/download/${FIXPOINT_VERSION}/${NAME}"

echo "Downloading from $URL"
curl -fsSL --retry 3 -o "$NAME" "$URL"

echo "Extracting archive"
tar -xzf "$NAME"
mkdir -p ~/.local/bin
cp fixpoint ~/.local/bin/fixpoint

echo "Cleaning up"
rm -f "$NAME"

- name: Install Z3
uses: cda-tum/setup-z3@v1.6.1
with:
version: 4.12.1
platform: linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Clone Flux
run: |
git clone https://github.com/flux-rs/flux.git
cd flux
git checkout $FLUX_VERSION

- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.8
with:
workspaces: flux

- name: Install Flux
run: |
cd flux
cargo x install

- name: Verify Core
run: |
cd library
FLUXFLAGS="-Ftimings" cargo flux -p core
15 changes: 14 additions & 1 deletion .github/workflows/kani-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ defaults:

jobs:
update-kani-metrics:
permissions:
contents: write
pull-requests: write
if: github.repository == 'model-checking/verify-rust-std'
runs-on: ubuntu-latest

steps:
- name: Remove unnecessary software to free up disk space
run: |
# inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/local/.ghcup
df -h

- name: Checkout Repository
uses: actions/checkout@v4
with:
Expand All @@ -26,7 +37,9 @@ jobs:
python-version: '3.x'

- name: Compute Kani Metrics
run: ./scripts/run-kani.sh --run metrics --path ${{github.workspace}}
run: |
./scripts/run-kani.sh --run metrics --with-autoharness --path ${{github.workspace}}
rm kani-list.json

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
Expand Down
Loading