Skip to content

Commit ca7d500

Browse files
authored
Merge branch 'model-checking:main' into transmute
2 parents 955c8ba + 0269891 commit ca7d500

551 files changed

Lines changed: 12623 additions & 10455 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_requests.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ members = [
99
"remi-delmas-3000",
1010
"qinheping",
1111
"tautschnig",
12-
"jaisnan",
1312
"patricklam",
1413
"ranjitjhala",
1514
"carolynzech",
@@ -18,5 +17,7 @@ members = [
1817
"Eh2406",
1918
"jswrenn",
2019
"havelund",
21-
"jorajeev"
20+
"jorajeev",
21+
"rajath-mk",
22+
"thanhnguyen-aws"
2223
]

.github/workflows/update-subtree.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaults:
1111

1212
jobs:
1313
update-subtree-library:
14-
runs-on: ubuntu-latest
14+
# Changing the host platform may alter the libgit2 version as used by
15+
# splitsh-lite, which will require changing the version of git2go.
16+
# See https://github.com/jeffWelling/git2go?tab=readme-ov-file#which-go-version-to-use
17+
runs-on: ubuntu-24.04
1518

1619
steps:
1720
- name: Checkout Repository
@@ -34,12 +37,6 @@ jobs:
3437
fetch-depth: 0
3538
path: rust-tmp
3639

37-
- name: Checkout git-filter-repo
38-
uses: actions/checkout@v4
39-
with:
40-
repository: newren/git-filter-repo
41-
path: git-filter-repo
42-
4340
- name: Fetch toolchain versions
4441
run: |
4542
CURRENT_TOOLCHAIN_DATE=$(grep -oP 'channel = "nightly-\K\d{4}-\d{2}-\d{2}' verify-rust-std/rust-toolchain.toml)
@@ -77,6 +74,30 @@ jobs:
7774
env:
7875
GH_TOKEN: ${{ github.token }}
7976

77+
- name: Checkout splitsh-lite
78+
if: ${{ env.SUBTREE_PR_EXISTS == 'no' }}
79+
uses: actions/checkout@v4
80+
with:
81+
repository: splitsh/lite
82+
path: splitsh-lite
83+
84+
- name: Build splitsh-lite
85+
if: ${{ env.SUBTREE_PR_EXISTS == 'no' }}
86+
run: |
87+
cd splitsh-lite
88+
sudo apt-get install -y golang libgit2-dev
89+
# git2go upstream hasn't been updated to more recent versions of
90+
# libgit2, so using a fork that does stay up to date
91+
sed -i 's#github.com/libgit2/git2go#github.com/jeffwelling/git2go#' go.mod splitter/*
92+
# may need to adjust "v37" to a higher number per
93+
# https://github.com/jeffWelling/git2go?tab=readme-ov-file#which-go-version-to-use
94+
# depening on the libgit2 version being installed
95+
sed -i -e 's/v34/v37/g' go.mod splitter/*.go
96+
# v37.0.0 had issues that weren't fully fixed until v37.0.4
97+
sed -i 's/v37.0.0/v37.0.4/' go.mod
98+
go mod tidy
99+
go build -o splitsh-lite github.com/splitsh/lite
100+
80101
- name: Update subtree/library locally
81102
if: ${{ env.SUBTREE_PR_EXISTS == 'no' }}
82103
run: |
@@ -89,15 +110,16 @@ jobs:
89110
fi
90111
91112
git checkout ${NEXT_COMMIT_HASH}
92-
../git-filter-repo/git-filter-repo --subdirectory-filter library --force
93-
git checkout -b subtree/library
113+
/usr/bin/time -v ../splitsh-lite/splitsh-lite --progress --prefix=library --target subtree/library
114+
git checkout -b subtree/library subtree/library
94115
95116
cd ../verify-rust-std
96117
git remote add rust-filtered ../rust-tmp/
97118
git fetch rust-filtered
98119
git checkout -b subtree/library rust-filtered/subtree/library
99-
# The filter-subtree operation adds an extraneous `library/` folder containing the submodules
100-
# (c.f. https://github.com/model-checking/verify-rust-std/issues/249), so remove that before committing.
120+
# The checkout still leaves behind the library folder with submodules.
121+
# We need to remove this as we'd otherwise have the create-pull-request
122+
# action create an extra commit.
101123
rm -rf library
102124
SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library)
103125
UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library)
@@ -107,7 +129,6 @@ jobs:
107129
echo "MERGE_CONFLICTS=noop" >> $GITHUB_ENV
108130
else
109131
git branch --set-upstream-to=origin/subtree/library
110-
git -c user.name=gitbot -c user.email=git@bot rebase
111132
echo "MERGE_CONFLICTS=maybe" >> $GITHUB_ENV
112133
fi
113134
@@ -130,12 +151,15 @@ jobs:
130151
if: ${{ env.MERGE_CONFLICTS != 'noop' && env.MERGE_PR_EXISTS == 'no' }}
131152
run: |
132153
cd verify-rust-std
154+
if ! git rev-parse --verify subtree/library; then
155+
git checkout -t -b subtree/library origin/update-subtree/library
156+
fi
133157
git checkout main
134158
135159
# This command may fail, which will require human intervention.
136160
if ! git \
137161
-c user.name=gitbot -c user.email=git@bot \
138-
subtree merge --prefix=library update-subtree/library --squash; then
162+
subtree merge --prefix=library subtree/library --squash; then
139163
echo "MERGE_CONFLICTS=yes" >> $GITHUB_ENV
140164
git -c user.name=gitbot -c user.email=git@bot commit -a -m "Merge from $NEXT_COMMIT_HASH with conflicts"
141165
else

doc/mdbook-metrics/src/main.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ fn run_kani_metrics_script() -> Result<(), Error> {
4444
Command::new("python")
4545
.args(&[
4646
"kani_std_analysis.py",
47+
"--crate",
48+
"core",
49+
"--metrics-file",
50+
"metrics-data-core.json",
51+
"--plot-only",
52+
"--plot-dir",
53+
&tools_path.to_string_lossy(),
54+
])
55+
.stdout(std::process::Stdio::null())
56+
.stderr(std::process::Stdio::null())
57+
.status()?;
58+
59+
Command::new("python")
60+
.args(&[
61+
"kani_std_analysis.py",
62+
"--crate",
63+
"std",
64+
"--metrics-file",
65+
"metrics-data-std.json",
4766
"--plot-only",
4867
"--plot-dir",
4968
&tools_path.to_string_lossy(),
@@ -83,12 +102,19 @@ fn add_graphs(chapter: &mut Chapter) {
83102
84103
Note that these metrics are for x86-64 architectures.
85104
86-
## `core`
105+
### `core`
87106
![Unsafe Metrics](core_unsafe_metrics.png)
88107
89108
![Safe Abstractions Metrics](core_safe_abstractions_metrics.png)
90109
91110
![Safe Metrics](core_safe_metrics.png)
111+
112+
### `std`
113+
![Unsafe Metrics](std_unsafe_metrics.png)
114+
115+
![Safe Abstractions Metrics](std_safe_abstractions_metrics.png)
116+
117+
![Safe Metrics](std_safe_metrics.png)
92118
"#;
93119

94120
chapter.content.push_str(new_content);

doc/src/challenges/0006-nonnull.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Challenge 6: Safety of NonNull
22

3-
- **Status:** Open
3+
- **Status:** Resolved
44
- **Tracking Issue:** [#53](https://github.com/model-checking/verify-rust-std/issues/53)
55
- **Start date:** *2024/08/16*
66
- **End date:** *2025/04/10*
77
- **Reward:** *N/A*
8-
8+
- **Contributors**: [Quinyuan Wu](https://github.com/QinyuanWu), [Daniel Tu](https://github.com/danielhumanmod), [Dhvani Kapadia](https://github.com/Dhvani-Kapadia) and [Jiun Chi Yang](https://github.com/Jimmycreative)
99
-------------------
1010

1111

doc/src/challenges/0008-smallsort.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
## Goal
1313

14-
The implementations of the traits `StableSmallSortTypeImpl`, `UnstableSmallSortTypeImpl`, and `UnstableSmallSortFreezeTypeImpl` in the `smallsort` [module](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/sort/shared/smallsort.rs) of the Rust standard library are the sorting
15-
algorithms optimized for slices with small lengths.
14+
The implementations of the traits `StableSmallSortTypeImpl`, `UnstableSmallSortTypeImpl`, and `UnstableSmallSortFreezeTypeImpl` in the `smallsort` [module](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/sort/shared/smallsort.rs) of the Rust standard library are the sorting algorithms with optimized implementations for slices with small lengths.
1615
In this challenge, the goal is to, first prove the memory safety of the public functions in the `smallsort` module, and, second, write contracts for them to
1716
show that the sorting algorithms actually sort the slices.
1817

doc/src/challenges/0012-nonzero.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ Verify the safety of the following functions and methods (all located within `co
7373
| `from_mut` |
7474
| `from_mut_unchecked` |
7575

76-
You are not required to write correctness contracts for these methods (e.g., for `max`, ensuring that the `result` is indeed the maximum of the inputs), but it would be great to do so!
7776

7877
### List of UBs
7978

doc/src/challenges/0014-convert-num.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Challenge 14: Safety of Primitive Conversions
22

3-
- **Status:** Open
4-
- **Tracking Issue:** https://github.com/model-checking/verify-rust-std/issues/220
3+
- **Status:** Resolved
4+
- **Tracking Issue:** [#220](https://github.com/model-checking/verify-rust-std/issues/220)
55
- **Start date:** 2024/12/15
66
- **End date:** 2025/2/28
77
- **Prize:** *TBD*
8-
8+
- **Contributors**: [Shoyu Vanilla](https://github.com/ShoyuVanilla)
99
-------------------
1010

1111
## Goal

doc/src/challenges/0015-intrinsics-simd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- **Status:** Open
44
- **Reward:**
55
- **Solution:**
6-
- **Tracking Issue:** https://github.com/model-checking/verify-rust-std/issues/173
6+
- **Tracking Issue:** [#173](https://github.com/model-checking/verify-rust-std/issues/173)
77
- **Start date:** 2025/02/01
88
- **End date:** 2025/08/01
99

0 commit comments

Comments
 (0)