Skip to content

Commit d23768b

Browse files
committed
Merge branch 'main' into verifast-scripts
2 parents 49f04e9 + d673526 commit d23768b

File tree

12 files changed

+2201
-445
lines changed

12 files changed

+2201
-445
lines changed

library/core/src/ub_checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub use predicates::*;
192192
#[cfg(not(kani))]
193193
mod predicates {
194194
/// Checks if a pointer can be dereferenced, ensuring:
195-
/// * `src` is valid for reads (see [`crate::ptr`] documentation).
195+
/// * `src` is valid for reads and writes (see [`crate::ptr`] documentation).
196196
/// * `src` is properly aligned (use `read_unaligned` if not).
197197
/// * `src` points to a properly initialized value of type `T`.
198198
///

scripts/kani-std-analysis/metrics-data-core.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,72 @@
754754
"verified_safe_fns_under_contract": 112,
755755
"verified_safe_fns_with_loop_under_contract": 1,
756756
"total_functions_under_contract_all_crates": 424
757+
},
758+
{
759+
"date": "2025-11-09",
760+
"total_unsafe_fns": 7235,
761+
"total_unsafe_fns_with_loop": 22,
762+
"total_safe_abstractions": 1936,
763+
"total_safe_abstractions_with_loop": 90,
764+
"total_safe_fns": 16014,
765+
"total_safe_fns_with_loop": 778,
766+
"unsafe_fns_under_contract": 290,
767+
"unsafe_fns_with_loop_under_contract": 3,
768+
"verified_unsafe_fns_under_contract": 254,
769+
"verified_unsafe_fns_with_loop_under_contract": 1,
770+
"safe_abstractions_under_contract": 77,
771+
"safe_abstractions_with_loop_under_contract": 0,
772+
"verified_safe_abstractions_under_contract": 77,
773+
"verified_safe_abstractions_with_loop_under_contract": 0,
774+
"safe_fns_under_contract": 115,
775+
"safe_fns_with_loop_under_contract": 1,
776+
"verified_safe_fns_under_contract": 112,
777+
"verified_safe_fns_with_loop_under_contract": 1,
778+
"total_functions_under_contract_all_crates": 424
779+
},
780+
{
781+
"date": "2025-11-16",
782+
"total_unsafe_fns": 7235,
783+
"total_unsafe_fns_with_loop": 22,
784+
"total_safe_abstractions": 1936,
785+
"total_safe_abstractions_with_loop": 90,
786+
"total_safe_fns": 16014,
787+
"total_safe_fns_with_loop": 778,
788+
"unsafe_fns_under_contract": 290,
789+
"unsafe_fns_with_loop_under_contract": 3,
790+
"verified_unsafe_fns_under_contract": 254,
791+
"verified_unsafe_fns_with_loop_under_contract": 1,
792+
"safe_abstractions_under_contract": 77,
793+
"safe_abstractions_with_loop_under_contract": 0,
794+
"verified_safe_abstractions_under_contract": 77,
795+
"verified_safe_abstractions_with_loop_under_contract": 0,
796+
"safe_fns_under_contract": 115,
797+
"safe_fns_with_loop_under_contract": 1,
798+
"verified_safe_fns_under_contract": 112,
799+
"verified_safe_fns_with_loop_under_contract": 1,
800+
"total_functions_under_contract_all_crates": 424
801+
},
802+
{
803+
"date": "2025-11-23",
804+
"total_unsafe_fns": 7235,
805+
"total_unsafe_fns_with_loop": 22,
806+
"total_safe_abstractions": 1936,
807+
"total_safe_abstractions_with_loop": 90,
808+
"total_safe_fns": 16014,
809+
"total_safe_fns_with_loop": 778,
810+
"unsafe_fns_under_contract": 290,
811+
"unsafe_fns_with_loop_under_contract": 3,
812+
"verified_unsafe_fns_under_contract": 254,
813+
"verified_unsafe_fns_with_loop_under_contract": 1,
814+
"safe_abstractions_under_contract": 77,
815+
"safe_abstractions_with_loop_under_contract": 0,
816+
"verified_safe_abstractions_under_contract": 77,
817+
"verified_safe_abstractions_with_loop_under_contract": 0,
818+
"safe_fns_under_contract": 115,
819+
"safe_fns_with_loop_under_contract": 1,
820+
"verified_safe_fns_under_contract": 112,
821+
"verified_safe_fns_with_loop_under_contract": 1,
822+
"total_functions_under_contract_all_crates": 424
757823
}
758824
]
759825
}

scripts/kani-std-analysis/metrics-data-std.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,72 @@
637637
"verified_safe_fns_under_contract": 0,
638638
"verified_safe_fns_with_loop_under_contract": 0,
639639
"total_functions_under_contract_all_crates": 424
640+
},
641+
{
642+
"date": "2025-11-09",
643+
"total_unsafe_fns": 180,
644+
"total_unsafe_fns_with_loop": 12,
645+
"total_safe_abstractions": 510,
646+
"total_safe_abstractions_with_loop": 42,
647+
"total_safe_fns": 4115,
648+
"total_safe_fns_with_loop": 185,
649+
"unsafe_fns_under_contract": 10,
650+
"unsafe_fns_with_loop_under_contract": 1,
651+
"verified_unsafe_fns_under_contract": 7,
652+
"verified_unsafe_fns_with_loop_under_contract": 0,
653+
"safe_abstractions_under_contract": 0,
654+
"safe_abstractions_with_loop_under_contract": 0,
655+
"verified_safe_abstractions_under_contract": 0,
656+
"verified_safe_abstractions_with_loop_under_contract": 0,
657+
"safe_fns_under_contract": 0,
658+
"safe_fns_with_loop_under_contract": 0,
659+
"verified_safe_fns_under_contract": 0,
660+
"verified_safe_fns_with_loop_under_contract": 0,
661+
"total_functions_under_contract_all_crates": 424
662+
},
663+
{
664+
"date": "2025-11-16",
665+
"total_unsafe_fns": 180,
666+
"total_unsafe_fns_with_loop": 12,
667+
"total_safe_abstractions": 510,
668+
"total_safe_abstractions_with_loop": 42,
669+
"total_safe_fns": 4115,
670+
"total_safe_fns_with_loop": 185,
671+
"unsafe_fns_under_contract": 10,
672+
"unsafe_fns_with_loop_under_contract": 1,
673+
"verified_unsafe_fns_under_contract": 7,
674+
"verified_unsafe_fns_with_loop_under_contract": 0,
675+
"safe_abstractions_under_contract": 0,
676+
"safe_abstractions_with_loop_under_contract": 0,
677+
"verified_safe_abstractions_under_contract": 0,
678+
"verified_safe_abstractions_with_loop_under_contract": 0,
679+
"safe_fns_under_contract": 0,
680+
"safe_fns_with_loop_under_contract": 0,
681+
"verified_safe_fns_under_contract": 0,
682+
"verified_safe_fns_with_loop_under_contract": 0,
683+
"total_functions_under_contract_all_crates": 424
684+
},
685+
{
686+
"date": "2025-11-23",
687+
"total_unsafe_fns": 180,
688+
"total_unsafe_fns_with_loop": 12,
689+
"total_safe_abstractions": 510,
690+
"total_safe_abstractions_with_loop": 42,
691+
"total_safe_fns": 4115,
692+
"total_safe_fns_with_loop": 185,
693+
"unsafe_fns_under_contract": 10,
694+
"unsafe_fns_with_loop_under_contract": 1,
695+
"verified_unsafe_fns_under_contract": 7,
696+
"verified_unsafe_fns_with_loop_under_contract": 0,
697+
"safe_abstractions_under_contract": 0,
698+
"safe_abstractions_with_loop_under_contract": 0,
699+
"verified_safe_abstractions_under_contract": 0,
700+
"verified_safe_abstractions_with_loop_under_contract": 0,
701+
"safe_fns_under_contract": 0,
702+
"safe_fns_with_loop_under_contract": 0,
703+
"verified_safe_fns_under_contract": 0,
704+
"verified_safe_fns_with_loop_under_contract": 0,
705+
"total_functions_under_contract_all_crates": 424
640706
}
641707
]
642708
}

verifast-proofs/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
This directory contains [VeriFast](../doc/src/tools/verifast.md) proofs for (currently a very, very small) part of the standard library.
44

5-
> [!NOTE]
6-
> TL;DR: If the VeriFast CI action fails because of a failing diff, please run `verifast-proofs/patch-verifast-proofs.sh` to fix the problem.
5+
Specifically, it currently contains the following proofs:
6+
7+
- Partial proof of [LinkedList](alloc/collections/linked_list.rs/)
8+
- Partial proof of [RawVec](alloc/raw_vec/mod.rs/)
9+
10+
See each proof's accompanying README for a tour of the proof and applicable caveats.
11+
12+
## Maintaining the proofs
13+
14+
If the VeriFast CI action fails because of a failing diff, please run `cd verifast-proofs; ./patch-verifast-proofs.sh` to fix the problem.
15+
16+
## `-skip_specless_fns`
717

818
VeriFast supports selecting the code to verify on a function-by-function basis. By default, when given a `.rs` file VeriFast will try to verify [semantic well-typedness](https://verifast.github.io/verifast/rust-reference/non-unsafe-funcs.html) of all non-`unsafe` functions in that file (and in any submodules), and will require that the user provide specifications for all `unsafe` functions, which it will then verify against those specifications. However, when given the `-skip_specless_fns` command-line flag, VeriFast will skip all functions for which the user did not provide a specification.
919

verifast-proofs/alloc/collections/linked_list.rs-negative/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set -e -x
22

3-
export VFVERSION=25.07
3+
export VFVERSION=25.08
44

55
! verifast -rustc_args "--edition 2021 --cfg test" -skip_specless_fns verified/lib.rs
66
! refinement-checker --rustc-args "--edition 2021 --cfg test" original/lib.rs verified/lib.rs

verifast-proofs/alloc/collections/linked_list.rs/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn pop_front_node<'a>(&'a mut self) -> Option<Box<Node<T>, &'a A>>
382382
//@ open [?f]ref_initialized_::<A>(alloc_ref1)();
383383
let alloc_ref = &self.alloc;
384384

385-
r = match head {
385+
r = match head {
386386
None => {
387387
//@ close [f]ref_initialized_::<A>(alloc_ref)();
388388
//@ close_frac_borrow(f, ref_initialized_(alloc_ref));
@@ -572,13 +572,12 @@ closes it back up afterwards.
572572
First of all, this proof was performed with the following VeriFast command-line flags:
573573
- `-skip_specless_fns`: VeriFast ignores the functions that do not have a `req` or `ens` clause.
574574
- `-ignore_unwind_paths`: This proof ignores code that is reachable only when unwinding.
575-
- `-allow_assume`: This proof uses a number of `assume` ghost statements and `assume_correct` clauses. These must be carefully audited.
575+
- `-allow_assume`: This proof uses a number of `assume` ghost statements and `assume_correct` clauses. These must be carefully audited. Specifically, this proof uses `assume` statements to assume that the lifetime of the allocator used by the LinkedList value equals `'static`, i.e. this proof only applies if the global allocator or another allocator that lasts forever is used.
576576

577577
Secondly, since VeriFast uses the `rustc` frontend, which assumes a particular target architecture, VeriFast's results hold only for the used Rust toolchain's target architecture. When VeriFast reports "0 errors found" for a Rust program, it always reports the targeted architecture as well (e.g. `0 errors found (2149 statements verified) (target: x86_64-unknown-linux-gnu (LP64))`).
578578

579579
Thirdly, VeriFast has a number of [known unsoundnesses](https://github.com/verifast/verifast/issues?q=is%3Aissue+is%3Aopen+label%3Aunsoundness) (reasons why VeriFast might in some cases incorrectly accept a program), including the following:
580580
- VeriFast does not yet fully verify compliance with Rust's [pointer aliasing rules](https://doc.rust-lang.org/reference/behavior-considered-undefined.html).
581581
- VeriFast does not yet properly verify compliance of custom type interpretations with Rust's [variance](https://doc.rust-lang.org/reference/subtyping.html#variance) rules.
582-
- The current standard library specifications do not [prevent an allocated memory block from outliving its allocator](https://github.com/verifast/verifast/issues/829). This is sound only if the global allocator is used.
583582

584583
Fourthly, unlike foundational tools such as [RefinedRust](https://plv.mpi-sws.org/refinedrust/), VeriFast has not itself been verified, so there are undoubtedly also unknown unsoundnesses. Such unsoundnesses might exist in VeriFast's [symbolic execution engine](https://github.com/model-checking/verify-rust-std/issues/213#issuecomment-2531006855) [itself](https://github.com/model-checking/verify-rust-std/issues/213#issuecomment-2534922580) or in its [prelude](https://github.com/verifast/verifast/tree/master/bin/rust) (definitions and axioms automatically imported at the start of every verification run) or in the [specifications](https://github.com/verifast/verifast/blob/master/bin/rust/std/lib.rsspec) it uses for the Rust standard library functions called by the program being verified.

0 commit comments

Comments
 (0)