1
1
- ** Feature Name:** MIR Linker (mir_linker)
2
2
- ** RFC Tracking Issue** : < https://github.com/model-checking/kani/issues/1588 >
3
3
- ** RFC PR:** < https://github.com/model-checking/kani/pull/1600 >
4
- - ** Status:** Unstable
5
- - ** Version:** 2
4
+ - ** Status:** Stable
5
+ - ** Version:** 3
6
6
7
7
-------------------
8
8
@@ -23,7 +23,7 @@ The approach introduced in this RFC will have the following secondary benefits.
23
23
- Compared to linking against the standard library goto-models that take more than 5 GB.
24
24
- In a potential assessment mode, only analyze code that is reachable from all public items in the target crate.
25
25
26
- One downside is that if we decide to include a pre-compiled version of the std, our release bundle will double in size
26
+ One downside is that we will include a pre-compiled version of the std, our release bundle will double in size
27
27
(See [ Rational and Alternatives] ( 0001-mir-linker.md#rational-and-alternatives )
28
28
for more information on the size overhead).
29
29
This will negatively impact the time taken to set up Kani
@@ -97,7 +97,7 @@ The two options to be included in this RFC is starting from all local harnesses
97
97
The ` kani-compiler ` behavior will be customizable via a new flag:
98
98
99
99
```
100
- --reachability=[ harnesses | pub_fns | none | legacy ]
100
+ --reachability=[ harnesses | pub_fns | none | legacy | tests ]
101
101
```
102
102
103
103
where:
@@ -108,11 +108,12 @@ where:
108
108
reachability analysis. No goto-program will be generated.
109
109
This will be used to compile dependencies up to the MIR level.
110
110
` kani-compiler ` will still generate artifacts with the crate's MIR.
111
- - ` legacy ` : Keep ` kani-compiler ` current behavior by using
112
- ` rustc_monomorphizer::collect_and_partition_mono_items() ` which respects the crate boundary.
113
- This will generate a goto-program for each crate compiled by ` kani-compiler ` , and it will still have the same
114
- ` std ` linking issues.
115
- * This option will be removed as part of the ` rfc ` stabilization.*
111
+ - ` tests ` : Use the functions marked as tests with ` #[tests] ` as the starting points for the analysis.
112
+ - ` legacy ` : Mimics ` rustc ` behavior by invoking
113
+ ` rustc_monomorphizer::collect_and_partition_mono_items() ` to collect the items to be generated.
114
+ This will not include many items that go beyond the crate boundary.
115
+ * This option was only kept for now for internal usage in some of our compiler tests.*
116
+ * It cannot be used as part of the end to end verification flow, and it will be removed in the future.*
116
117
117
118
These flags will not be exposed to the final user.
118
119
They will only be used for the communication between ` kani-driver ` and ` kani-compiler ` .
@@ -203,7 +204,7 @@ See the table bellow for the breakdown of time (in seconds) taken for each major
203
204
the harness verification:
204
205
205
206
206
- | Stage | MIR Linker | Alternative |
207
+ | Stage | MIR Linker | Alternative 1 |
207
208
----------------------------|------------|-------------|
208
209
| compilation | 22.2s | 64.7s |
209
210
| goto-program generation | 2.4s | 90.7s |
@@ -229,14 +230,16 @@ These results were obtained by looking at the artifacts generated during the sam
229
230
230
231
## Open questions
231
232
232
- - Should we build or download the sysroot during ` kani setup ` ?
233
- - What's the best way to enable support to run Kani in the entire ` workspace ` ?
234
- - One possibility is to run ` cargo rustc ` per package.
235
- - Should we codegen all static items no matter what? Static objects can only be initialized via constant function.
236
- Thus, it shouldn't have any side effect.
237
- That relies on all constant initializers being evaluated during compilation.
233
+ - ~~ Should we build or download the sysroot during ` kani setup ` ?~~
234
+ We include pre-built MIR artifacts for the ` std ` library.
235
+ - ~~ What's the best way to enable support to run Kani in the entire ` workspace ` ?~~
236
+ We decided to run ` cargo rustc ` per package.
237
+ - ~~ Should we codegen all static items no matter what?~~
238
+ We only generate code for static items that are collected by the reachability analysis.
239
+ Static objects can only be initialized via constant function.
240
+ Thus, it shouldn't have any side effect.
238
241
- ~~ What's the best way to handle ` cargo kani --tests ` ?~~
239
- For now, we are going to use the test profile and iterate over all the targets available in the crate:
242
+ We are going to use the test profile and iterate over all the targets available in the crate:
240
243
- ` cargo rustc --profile test -- --reachability=harnesses `
241
244
242
245
0 commit comments