Skip to content

Challenge 19: Verify the safety of RawVec #283

Open

Activity

changed the title [-]Challenge 19: Verify the safety of `slice` iter functions - part 2[/-] [+]Challenge 19: Verify the safety of RawVec[/+] on Apr 4, 2025
btj

btj commented on Jun 20, 2025

@btj

I'm having a go at this challenge with VeriFast. So far, I've verified (with the caveats mentioned below) RawVecInner::current_memory and RawVecInner::deallocate, using this data structure invariant.

Caveats

First of all, I'm performing this proof with the following VeriFast command-line flags:

  • -skip_specless_fns: VeriFast ignores the functions that do not have a req or ens clause.
  • -ignore_unwind_paths: This proof ignores code that is reachable only when unwinding.
  • -allow_assume: This proof uses a number of assume ghost statements and assume_correct clauses. These must be carefully audited.

Secondly, since VeriFast uses the rustc frontend, which assumes a particular target architecture, VeriFast's results apply only to the target architecture of the Rust toolchain being used.

Thirdly, VeriFast has a number of known unsoundnesses (reasons why VeriFast might in some cases incorrectly accept a program), including the following:

Fourthly, unlike foundational tools such as RefinedRust, VeriFast has not itself been verified, so there are undoubtedly also unknown unsoundnesses.

btj

btj commented on Jul 7, 2025

@btj

I've now also verified RawVecInner::new_in and RawVecInner::try_allocate_in. To make these proofs go through, I had to fix a bug in the data structure invariant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ChallengeUsed to tag a challenge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @btj@thanhnguyen-aws

        Issue actions

          Challenge 19: Verify the safety of RawVec · Issue #283 · model-checking/verify-rust-std