Skip to content

Commit

Permalink
Merge branch 'main' into dhvani_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig authored Dec 10, 2024
2 parents 4ce3119 + 82893c5 commit bcf4586
Show file tree
Hide file tree
Showing 18 changed files with 1,617 additions and 97 deletions.
1 change: 1 addition & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: Build Book
on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down
38 changes: 12 additions & 26 deletions .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Kani

on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down Expand Up @@ -37,18 +38,10 @@ jobs:
# Step 2: Run Kani on the std library (default configuration)
- name: Run Kani Verification
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head

test-kani-script:
name: Test Kani script
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
base: ubuntu
- os: macos-latest
base: macos

run-kani-list:
name: Kani List
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout Repository
Expand All @@ -57,25 +50,18 @@ jobs:
path: head
submodules: true

# Step 2: Test Kani verification script with specific arguments
- name: Test Kani script (Custom Args)
run: head/scripts/run-kani.sh -p ${{github.workspace}}/head --kani-args --harness ptr --output-format=terse

# Step 3: Test Kani verification script in the repository directory
- name: Test Kani script (In Repo Directory)
working-directory: ${{github.workspace}}/head
run: scripts/run-kani.sh --kani-args --harness ptr::verify::check_read_u128 --harness ptr --output-format=terse

# Step 4: Run list on the std library and add output to job summary
# Step 2: Run list on the std library
- name: Run Kani List
run: head/scripts/run-kani.sh --run list --path ${{github.workspace}}/head


# Step 3: Add output to job summary
- name: Add Kani List output to job summary
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const kaniOutput = fs.readFileSync('${{github.workspace}}/head/kani_list.txt', 'utf8');
const kaniOutput = fs.readFileSync('${{github.workspace}}/head/kani-list.md', 'utf8');
await core.summary
.addRaw(kaniOutput)
.write();
.addHeading('Kani List Output', 2)
.addRaw(kaniOutput, false)
.write();
20 changes: 14 additions & 6 deletions .github/workflows/pr_approval.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# This workflow checks that the PR has been approved by 2+ members of the committee listed in `pull_requests.toml`.
#
# Run this action when a pull request review is submitted / dismissed.
# Note that an approval can be dismissed, and this can affect the job status.
# We currently trust that contributors won't make significant changes to their PRs after approval, so we accept
# changes after approval.
#
# We still need to run this in the case of a merge group, since it is a required step. In that case, the workflow
# is a NOP.
name: Check PR Approvals

# For now, the workflow gets triggered only when a review is submitted
# This technically means, a PR with zero approvals can be merged by the rules of this workflow alone
# To protect against that scenario, we can turn on number of approvals required to 2 in the github settings
# of the repository
on:
merge_group:
pull_request_review:
types: [submitted]
types: [submitted, dismissed]

jobs:
check-approvals:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
if: ${{ github.event_name != 'merge_group' }}

- name: Install TOML parser
run: npm install @iarna/toml
if: ${{ github.event_name != 'merge_group' }}

- name: Check PR Relevance and Approvals
uses: actions/github-script@v6
if: ${{ github.event_name != 'merge_group' }}
with:
script: |
const fs = require('fs');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Rust Tests
on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down
46 changes: 23 additions & 23 deletions doc/src/challenges/0002-intrinsics-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ Annotate Rust core::intrinsics functions that manipulate raw pointers with their

Intrinsic functions to be annotated with safety contracts

| Function | Location |
|---------|---------|
|typed_swap | core::intrisics |
|vtable_size| core::intrisics |
|vtable_align| core::intrisics |
|copy_nonoverlapping| core::intrisics |
|copy| core::intrisics |
|write_bytes| core::intrisics |
|size_of_val| core::intrisics |
|arith_offset| core::intrisics |
|volatile_copy_nonoverlapping_memory| core::intrisics |
|volatile_copy_memory| core::intrisics |
|volatile_set_memory| core::intrisics |
|volatile_load| core::intrisics |
|volatile_store| core::intrisics |
|unaligned_volatile_load| core::intrisics |
|unaligned_volatile_store| core::intrisics |
|compare_bytes| core::intrisics |
|min_align_of_val| core::intrisics |
|ptr_offset_from| core::intrisics |
|ptr_offset_from_unsigned| core::intrisics |
|read_via_copy| core::intrisics |
|write_via_move| core::intrisics |
| Function | Location |
|-------------------------------------|-----------------|
| typed_swap | core::intrisics |
| vtable_size | core::intrisics |
| vtable_align | core::intrisics |
| copy_nonoverlapping | core::intrisics |
| copy | core::intrisics |
| write_bytes | core::intrisics |
| size_of_val | core::intrisics |
| arith_offset | core::intrisics |
| volatile_copy_nonoverlapping_memory | core::intrisics |
| volatile_copy_memory | core::intrisics |
| volatile_set_memory | core::intrisics |
| volatile_load | core::intrisics |
| volatile_store | core::intrisics |
| unaligned_volatile_load | core::intrisics |
| unaligned_volatile_store | core::intrisics |
| compare_bytes | core::intrisics |
| min_align_of_val | core::intrisics |
| ptr_offset_from | core::intrisics |
| ptr_offset_from_unsigned | core::intrisics |
| read_via_copy | core::intrisics |
| write_via_move | core::intrisics |


All the following usages of intrinsics were proven safe:
Expand Down
2 changes: 1 addition & 1 deletion doc/src/challenges/0003-pointer-arithmentic.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ At least 3 of the following usages were proven safe:

| Function | Location |
|-------------------|---------------|
| \[u8\]::is_asc_ii | core::slice |
| \[u8\]::is_ascii | core::slice |
| String::remove | alloc::string |
| Vec::swap_remove | alloc::vec |
| Option::as_slice | core::option |
Expand Down
5 changes: 3 additions & 2 deletions doc/src/challenges/0011-floats-ints.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Challenge 11: Safety of Methods for Numeric Primitive Types


- **Status:** Open
- **Status:** Resolved
- **Tracking Issue:** [#59](https://github.com/model-checking/verify-rust-std/issues/59)
- **Start date:** *2024/08/20*
- **End date:** *2025/04/10*
- **End date:** *2024/12/04*
- **Reward:** *N/A*
- **Contributors**: [Rajath M Kotyal](https://github.com/rajathkotyal), [Yen-Yun Wu](https://github.com/Yenyun035), [Lanfei Ma](https://github.com/lanfeima), [Junfeng Jin](https://github.com/MWDZ)

-------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/src/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The verification tool ecosystem for Rust is rapidly growing, and we welcome the
In this chapter, you can find a list of tools that have already been approved for new solutions,
what is their CI current status, as well as more details on how to use them.

If the tool you would like to add a new tool to the list of tool applications,
If you would like to add a new tool to the list of tool applications,
please see the [Tool Application](general-rules.md#tool-applications) section.

## Approved tools:
Expand Down
Loading

0 comments on commit bcf4586

Please sign in to comment.