From 4f9425a31ff5e1e0d6466c20c08ddd0d3e3656c6 Mon Sep 17 00:00:00 2001 From: Adrian Palacios Date: Tue, 27 Jun 2023 19:03:43 +0000 Subject: [PATCH 1/3] RFC: Kani version --- rfc/src/rfcs/0008-kani-version.md | 106 ++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 rfc/src/rfcs/0008-kani-version.md diff --git a/rfc/src/rfcs/0008-kani-version.md b/rfc/src/rfcs/0008-kani-version.md new file mode 100644 index 000000000000..b6e1a3312071 --- /dev/null +++ b/rfc/src/rfcs/0008-kani-version.md @@ -0,0 +1,106 @@ +- **Feature Name:** Print Kani version (`kani-version`)* +- **Feature Request Issue:** +- **RFC PR:** +- **Status:** Under Review +- **Version:** 0 + +------------------- + +## Summary + +Print the version of Kani at the beginning of a run. + +## User Impact + +Many programs print their version at the beginning of a run. +The version of a program communicates the state of the software at a given point (e.g., features that are available or performance on particular problems). +At present, Kani does not print its version, but it's something we should strongly consider from now on. + +There are many benefits to including the version of Kani in its output. +However, I think the main ones will be the following: + * **Earlier detection of version-related discrepancies**: + Users are likely to discuss discrepancies in verification outcomes by looking at Kani's output. + These may look exactly the same[^cbmc-version] (except for the discrepant value) on two different versions of Kani. + Including the version will help users realize sooner that they're using different versions of Kani. + * **Simpler issue triaging**: + New issues require users to post the Kani version they used. + Getting this information requires another call with `--version`, which wouldn't be needed if we simply printed the version. + Also, note that users may need to do more work if they aren't running Kani locally (e.g., Kani running in CI). + +In addition, printing the Kani version may be useful for other purposes (automate CI processes, help users realize they're using outdated versions, etc.). + +## User Experience + +The first line printed in any Kani invocation (either through `kani` or `cargo kani`, and regardless of subcommands) will inform users of the version. +The behavior will be extended for development versions, where it'll print the short hash of the HEAD commit in addition to the version. + +### Release versions + +The first line to be printed will be: + +``` +Launching the Kani Rust Verifier +``` + +where `` is the version of Kani under use, which follows the semantic versioning format `MAJOR.MINOR.PATCH`. + +For example, for the release version of [Kani 0.29.0](https://github.com/model-checking/kani/releases/tag/kani-0.29.0), this would have printed: + +``` +Launching the Kani Rust Verifier 0.29.0 +``` + +### Development versions + +The first line to be printed will be: + +``` +Launching the Kani Rust Verifier (dev. version - commit: ) +``` + +where `` is the version of Kani under use, which follows the semantic versioning format `MAJOR.MINOR.PATCH`, +and `` is the short hash (i.e., 7 hexadecimal digits with format `hhhhhhh`) of the `HEAD` commit. + +For example, for the development version of [Kani 0.29.0](https://github.com/model-checking/kani/releases/tag/kani-0.29.0), this would have printed: + +``` +Launching the Kani Rust Verifier 0.29.0 (dev. version - commit: e4f989b) +``` + +## Detailed Design + +The implementation will require additions to the `kani-driver` module. + +Printing the short hash of the `HEAD` commit would require `git` as a dependency, but it can be made optional if we print `unknown` in the case where `git` isn't available. + +## Rationale and alternatives + +It's possible to argue that Kani shouldn't print its version because other (related) tools don't (e.g., `rustc`). +However, many of those tools are expected to NOT produce any output when all went well (i.e., no errors nor warnings when compiling a program). +This isn't something we expect Kani to do though: it'll always produce some output to inform users about the verification results. + +In my experience, we should print the version because users and developers use text-based log files containing Kani's output to discuss verification results. +In some cases, we've had to "calculate" the Kani version from the CBMC versions appearing in the log. +But we shouldn't need to in the first place. + +### Style alternatives + +It'd be great to discuss any alternatives for the concrete format. +At some point, I even thought about adding some ASCII art, but wanted to keep it short and simple. + +For example, we could: + - Replace the word `Launching` with another one. + - Prefix the version with `v` (so the version gets printed as `v0.29.0`, for example). + - Just print `Kani Rust Verifier `, nothing else. + +These are low-level details which I'd love to discuss with you all. + +## Open questions + +I'm hoping that we can answer the following questions during the RFC: + 1. Do we want to print Kani's version? + 2. If we decide to move forward, what's your preferred style? + +## Future possibilities + +No future possibilities are under consideration. From f39db2c346e5d8737291ad648c2125cda2a8e747 Mon Sep 17 00:00:00 2001 From: Adrian Palacios Date: Tue, 27 Jun 2023 19:11:23 +0000 Subject: [PATCH 2/3] Add missing footnote --- rfc/src/rfcs/0008-kani-version.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rfc/src/rfcs/0008-kani-version.md b/rfc/src/rfcs/0008-kani-version.md index b6e1a3312071..95cb0312f396 100644 --- a/rfc/src/rfcs/0008-kani-version.md +++ b/rfc/src/rfcs/0008-kani-version.md @@ -104,3 +104,6 @@ I'm hoping that we can answer the following questions during the RFC: ## Future possibilities No future possibilities are under consideration. + +[^cbmc-version]: The CBMC version is printed once for each harness. +That'd be the main difference between outputs from different versions, but only if the CBMC version was bumped in between. From ced2834bc0042c504e535aa6f7789674383c4d6b Mon Sep 17 00:00:00 2001 From: Adrian Palacios Date: Tue, 27 Jun 2023 19:12:51 +0000 Subject: [PATCH 3/3] small fixup --- rfc/src/rfcs/0008-kani-version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfc/src/rfcs/0008-kani-version.md b/rfc/src/rfcs/0008-kani-version.md index 95cb0312f396..ebc2b39da4bd 100644 --- a/rfc/src/rfcs/0008-kani-version.md +++ b/rfc/src/rfcs/0008-kani-version.md @@ -1,4 +1,4 @@ -- **Feature Name:** Print Kani version (`kani-version`)* +- **Feature Name:** Print Kani version (`kani-version`) - **Feature Request Issue:** - **RFC PR:** - **Status:** Under Review