Skip to content
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

Support Primitive Proptests #1363

Closed
7 of 8 tasks
YoshikiTakashima opened this issue Jul 12, 2022 · 4 comments
Closed
7 of 8 tasks

Support Primitive Proptests #1363

YoshikiTakashima opened this issue Jul 12, 2022 · 4 comments
Assignees
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.

Comments

@YoshikiTakashima
Copy link
Contributor

YoshikiTakashima commented Jul 12, 2022

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.
@YoshikiTakashima YoshikiTakashima added the [C] Feature / Enhancement A new feature request or enhancement to an existing feature. label Jul 12, 2022
@YoshikiTakashima YoshikiTakashima self-assigned this Jul 12, 2022
@YoshikiTakashima YoshikiTakashima moved this to In Progress in Kani v0.7 Jul 12, 2022
@YoshikiTakashima YoshikiTakashima changed the title Support Primtive Proptests Support Primitive Proptests Jul 22, 2022
@YoshikiTakashima
Copy link
Contributor Author

YoshikiTakashima commented Jul 22, 2022

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

@YoshikiTakashima
Copy link
Contributor Author

YoshikiTakashima commented Jul 22, 2022

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

@YoshikiTakashima YoshikiTakashima moved this to In Progress in Kani v0.8 Jul 26, 2022
@YoshikiTakashima
Copy link
Contributor Author

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

@YoshikiTakashima
Copy link
Contributor Author

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

Repository owner moved this from In Progress to Done in Kani v0.7 Aug 16, 2022
Repository owner moved this from In Progress to Done in Kani v0.9 Aug 16, 2022
Repository owner moved this from Blocked to Done in Kani v0.8 Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.
Projects
No open projects
Status: Done
Status: Done
Status: Done
1 participant