Skip to content

Support Primitive Proptests #1363

Closed
Closed

Description

@YoshikiTakashima

Requested feature: Support primitive proptests.

Use case: Automatically converting proptests to Kani harnesses allow
us to serve large number of customers like tokio that have proptests
implemented but no Kani harnesses.

Test case:
https://github.com/YoshikiTakashima/kani/tree/yoshi-proptest-primitive/tests/proptest/primitive

Feature Branch on Fork: https://github.com/YoshikiTakashima/kani/tree/yoshi-proptest-primitive/

  • Figure out how to hijack proptest import and substitute our own.
    • See 334ec6e, for the overall import hijacking technique.
    • Change to kani-driver at
      a26fbcf makes it purge the old
      import. This avoids conflicting imports issue, and allows the
      hacked version of proptest to be the only one available.
  • Modify the proptest macro to build basic Kani harnessing.
  • Make the corresponding API:
    • any<T> for primitive T
    • Arbitrary and Strategy
    • Ranges of primitive values. Blocked until linking with -L is fixed.

Hacks/should be fixed before merge:

  • Only hard-coded path works for --extern import.
  • cargo-kani is not running the recovery part of modifying
    Cargo.toml.

Activity

  1. added
    [C] Feature / Enhancement
    on Jul 12, 2022
  2. moved this to In Progress in Kani v0.7on Jul 12, 2022
  3. changed the title [-]Support Primtive Proptests[/-] [+]Support Primitive Proptests[/+] on Jul 22, 2022
  4. YoshikiTakashima commented on Jul 22, 2022

    @YoshikiTakashima
    ContributorAuthor

    Replicating linker issue.

    First, replicate the kani version.

    git clone https://github.com/YoshikiTakashima/kani.git
    cd kani
    git checkout yoshi-proptest-primitive
    git checkout eac76a7e -- library/proptest/src/sugar.rs
    cargo clean; cargo build --workspace
    

    Then run it on the case that replicates this.

    git clone https://github.com/YoshikiTakashima/simplified-prost-rs-timestamp.git
    cd simplified-prost-rs-timestamp
    cargo kani
    
  5. YoshikiTakashima commented on Jul 22, 2022

    @YoshikiTakashima
    ContributorAuthor

    Info from deep dive: The following is required for kani to work. Currently, we only provide the rlib

    • *.rlib
    • symtab.json

    Possible
    --enable-unstable --c-lib <path to gotobinary> where gotobinary is *.goto

  6. moved this to In Progress in Kani v0.8on Jul 26, 2022
  7. YoshikiTakashima commented on Jul 30, 2022

    @YoshikiTakashima
    ContributorAuthor

    Code changes implemented to link proptest. After cleanup, we can merge.

  8. moved this from In Progress to Blocked in Kani v0.8on Aug 9, 2022
  9. moved this to In Progress in Kani v0.9on Aug 11, 2022
  10. YoshikiTakashima commented on Aug 16, 2022

    @YoshikiTakashima
    ContributorAuthor

    See the following comment for way to integrate proptest w/o significant changes. #1435 (comment)

  11. Repository owner moved this from In Progress to Done in Kani v0.7on Aug 16, 2022
  12. Repository owner moved this from In Progress to Done in Kani v0.9on Aug 16, 2022
  13. Repository owner moved this from Blocked to Done in Kani v0.8on Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[C] Feature / Enhancement

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions