Skip to content

Commit b558eff

Browse files
authored
Change MIR linker RFC to stable. (rust-lang#2136)
Update the RFC to capture the current state of the MIR linker and mark it as Stable.
1 parent cb05915 commit b558eff

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

rfc/src/rfcs/0001-mir-linker.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- **Feature Name:** MIR Linker (mir_linker)
22
- **RFC Tracking Issue**: <https://github.com/model-checking/kani/issues/1588>
33
- **RFC PR:** <https://github.com/model-checking/kani/pull/1600>
4-
- **Status:** Unstable
5-
- **Version:** 2
4+
- **Status:** Stable
5+
- **Version:** 3
66

77
-------------------
88

@@ -23,7 +23,7 @@ The approach introduced in this RFC will have the following secondary benefits.
2323
- Compared to linking against the standard library goto-models that take more than 5 GB.
2424
- In a potential assessment mode, only analyze code that is reachable from all public items in the target crate.
2525

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
2727
(See [Rational and Alternatives](0001-mir-linker.md#rational-and-alternatives)
2828
for more information on the size overhead).
2929
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
9797
The `kani-compiler` behavior will be customizable via a new flag:
9898

9999
```
100-
--reachability=[ harnesses | pub_fns | none | legacy ]
100+
--reachability=[ harnesses | pub_fns | none | legacy | tests ]
101101
```
102102

103103
where:
@@ -108,11 +108,12 @@ where:
108108
reachability analysis. No goto-program will be generated.
109109
This will be used to compile dependencies up to the MIR level.
110110
`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.*
116117

117118
These flags will not be exposed to the final user.
118119
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
203204
the harness verification:
204205

205206

206-
| Stage | MIR Linker | Alternative |
207+
| Stage | MIR Linker | Alternative 1 |
207208
----------------------------|------------|-------------|
208209
| compilation | 22.2s | 64.7s |
209210
| goto-program generation | 2.4s | 90.7s |
@@ -229,14 +230,16 @@ These results were obtained by looking at the artifacts generated during the sam
229230

230231
## Open questions
231232

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.
238241
- ~~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:
240243
- `cargo rustc --profile test -- --reachability=harnesses`
241244

242245

0 commit comments

Comments
 (0)