53
53
- name : Run Kani Verification
54
54
run : head/scripts/run-kani.sh --path ${{github.workspace}}/head
55
55
56
+ kani-autoharness :
57
+ name : Verify std library using autoharness
58
+ runs-on : ${{ matrix.os }}
59
+ strategy :
60
+ matrix :
61
+ os : [ubuntu-latest, macos-latest]
62
+ include :
63
+ - os : ubuntu-latest
64
+ base : ubuntu
65
+ - os : macos-latest
66
+ base : macos
67
+ fail-fast : false
68
+
69
+ steps :
70
+ # Step 1: Check out the repository
71
+ - name : Checkout Repository
72
+ uses : actions/checkout@v4
73
+ with :
74
+ submodules : true
75
+
76
+ # Step 2: Run Kani autoharness on the std library for selected functions.
77
+ # Uses "--include-pattern" to make sure we do not try to run across all
78
+ # possible functions as that may take a lot longer than expected. Instead,
79
+ # explicitly list all functions (or prefixes thereof) the proofs of which
80
+ # are known to pass.
81
+ - name : Run Kani Verification
82
+ run : |
83
+ scripts/run-kani.sh --run autoharness --kani-args \
84
+ --include-pattern alloc::layout::Layout::from_size_align \
85
+ --include-pattern ascii::ascii_char::AsciiChar::from_u8 \
86
+ --include-pattern char::convert::from_u32_unchecked \
87
+ --include-pattern "num::nonzero::NonZero::<i8>::count_ones" \
88
+ --include-pattern "num::nonzero::NonZero::<i16>::count_ones" \
89
+ --include-pattern "num::nonzero::NonZero::<i32>::count_ones" \
90
+ --include-pattern "num::nonzero::NonZero::<i64>::count_ones" \
91
+ --include-pattern "num::nonzero::NonZero::<i128>::count_ones" \
92
+ --include-pattern "num::nonzero::NonZero::<isize>::count_ones" \
93
+ --include-pattern "num::nonzero::NonZero::<u8>::count_ones" \
94
+ --include-pattern "num::nonzero::NonZero::<u16>::count_ones" \
95
+ --include-pattern "num::nonzero::NonZero::<u32>::count_ones" \
96
+ --include-pattern "num::nonzero::NonZero::<u64>::count_ones" \
97
+ --include-pattern "num::nonzero::NonZero::<u128>::count_ones" \
98
+ --include-pattern "num::nonzero::NonZero::<usize>::count_ones" \
99
+ --include-pattern "num::nonzero::NonZero::<i8>::rotate_" \
100
+ --include-pattern "num::nonzero::NonZero::<i16>::rotate_" \
101
+ --include-pattern "num::nonzero::NonZero::<i32>::rotate_" \
102
+ --include-pattern "num::nonzero::NonZero::<i64>::rotate_" \
103
+ --include-pattern "num::nonzero::NonZero::<i128>::rotate_" \
104
+ --include-pattern "num::nonzero::NonZero::<isize>::rotate_" \
105
+ --include-pattern "num::nonzero::NonZero::<u8>::rotate_" \
106
+ --include-pattern "num::nonzero::NonZero::<u16>::rotate_" \
107
+ --include-pattern "num::nonzero::NonZero::<u32>::rotate_" \
108
+ --include-pattern "num::nonzero::NonZero::<u64>::rotate_" \
109
+ --include-pattern "num::nonzero::NonZero::<u128>::rotate_" \
110
+ --include-pattern "num::nonzero::NonZero::<usize>::rotate_" \
111
+ --include-pattern ptr::align_offset::mod_inv \
112
+ --include-pattern ptr::alignment::Alignment::as_nonzero \
113
+ --include-pattern ptr::alignment::Alignment::as_usize \
114
+ --include-pattern ptr::alignment::Alignment::log2 \
115
+ --include-pattern ptr::alignment::Alignment::mask \
116
+ --include-pattern ptr::alignment::Alignment::new \
117
+ --include-pattern ptr::alignment::Alignment::new_unchecked \
118
+ --include-pattern time::Duration::from_micros \
119
+ --include-pattern time::Duration::from_millis \
120
+ --include-pattern time::Duration::from_nanos \
121
+ --include-pattern time::Duration::from_secs \
122
+ --exclude-pattern time::Duration::from_secs_f \
123
+ --include-pattern unicode::unicode_data::conversions::to_ \
124
+ --exclude-pattern ::precondition_check \
125
+ --harness-timeout 5m \
126
+ --default-unwind 1000 \
127
+ --jobs=3 --output-format=terse
128
+
56
129
run-kani-list :
57
130
name : Kani List
58
131
runs-on : ubuntu-latest
@@ -66,8 +139,14 @@ jobs:
66
139
67
140
# Step 2: Run list on the std library
68
141
- name : Run Kani List
69
- run : head/scripts/run-kani.sh --run list --path ${{github.workspace}}/head
70
-
142
+ run : |
143
+ head/scripts/run-kani.sh --run list --with-autoharness --path ${{github.workspace}}/head
144
+ # remove duplicate white space to reduce file size (GitHub permits at
145
+ # most one 1MB)
146
+ ls -l ${{github.workspace}}/head/kani-list.md
147
+ perl -p -i -e 's/ +/ /g' ${{github.workspace}}/head/kani-list.md
148
+ ls -l ${{github.workspace}}/head/kani-list.md
149
+
71
150
# Step 3: Add output to job summary
72
151
- name : Add Kani List output to job summary
73
152
uses : actions/github-script@v6
@@ -79,3 +158,30 @@ jobs:
79
158
.addHeading('Kani List Output', 2)
80
159
.addRaw(kaniOutput, false)
81
160
.write();
161
+
162
+ run-autoharness-analyzer :
163
+ name : Kani Autoharness Analyzer
164
+ runs-on : ubuntu-latest
165
+ steps :
166
+ # Step 1: Check out the repository
167
+ - name : Checkout Repository
168
+ uses : actions/checkout@v4
169
+ with :
170
+ submodules : true
171
+
172
+ # Step 2: Run autoharness analyzer on the std library
173
+ - name : Run Autoharness Analyzer
174
+ run : scripts/run-kani.sh --run autoharness-analyzer
175
+
176
+ # Step 3: Add output to job summary
177
+ - name : Add Autoharness Analyzer output to job summary
178
+ run : |
179
+ echo "# Autoharness Failure Summary" >> "$GITHUB_STEP_SUMMARY"
180
+ echo "## Crate core, all functions" >> "$GITHUB_STEP_SUMMARY"
181
+ cat autoharness_analyzer/core_autoharness_data.md >> "$GITHUB_STEP_SUMMARY"
182
+ echo "## Crate core, unsafe functions" >> "$GITHUB_STEP_SUMMARY"
183
+ cat autoharness_analyzer/core_autoharness_data.md >> "$GITHUB_STEP_SUMMARY"
184
+ echo "## Crate std, all functions" >> "$GITHUB_STEP_SUMMARY"
185
+ cat autoharness_analyzer/std_autoharness_data.md >> "$GITHUB_STEP_SUMMARY"
186
+ echo "## Crate std, unsafe functions" >> "$GITHUB_STEP_SUMMARY"
187
+ cat autoharness_analyzer/std_unsafe_autoharness_data.md >> "$GITHUB_STEP_SUMMARY"
0 commit comments