You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In May, we successfully merged **19 pull requests**!
9
+
10
+
[@Nadrieril](https://github.com/Nadrieril) helped making the frontend more robust and complete with work on impl exprs ([#1431](https://github.com/cryspen/hax/pull/1431)), MIR extraction ([#1444](https://github.com/cryspen/hax/pull/1444), [#1457](https://github.com/cryspen/hax/pull/1457)) and `FnOnce` ([#1477](https://github.com/cryspen/hax/pull/1477)).
11
+
12
+
[@W95Psp](https://github.com/W95Psp) worked on `hax-lib` with improved support for writing F* lemmas in Rust ([#1456](https://github.com/cryspen/hax/pull/1456)).
13
+
14
+
[@cmester0](https://github.com/cmester0) improved the Coq and SSProve backends ([#1426](https://github.com/cryspen/hax/pull/1426) and [#1108](https://github.com/cryspen/hax/pull/1108))
15
+
16
+
Apart from that, we contributed multiple F*[`core` library](https://doc.rust-lang.org/stable/core/) additions.
Copy file name to clipboardExpand all lines: docs/frontend/evaluation.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ For the crates that successfully generated ASTs, we compared the time taken by `
119
119
- On average, `cargo hax` is about 4–5 times slower than `cargo check`.
120
120
- At the **10th decile**, the slowdown is only about 2×, indicating better scaling for larger crates.
121
121
122
-
## Conclusion
122
+
###Conclusion
123
123
124
124
Our quantitative evaluation shows that the hax frontend successfully extracts ASTs for a large portion of the Rust ecosystem. Nevertheless, a small portion of crates reveal performance bottlenecks or outright failures that require further investigation and optimization.
125
125
@@ -131,3 +131,30 @@ These results also highlight a few **limitations** of this initial study:
131
131
Overall, the hax frontend demonstrates capabilities for large-scale Rust code verification, but continued refinement is needed to handle edge cases and improve performance.
132
132
133
133
[^1]: For a given crate, we normalize the times by dividing them by the total time.
134
+
135
+
## Qualitative evaluation
136
+
137
+
The qualitative evaluation aims at identifying what Rust patterns the frontend can handle. It also tests whether the information extracted from the frontend describes correctly the input Rust code.
138
+
139
+
### Rustc coverage test suite
140
+
141
+
The Rust compiler (rustc) has extensive test suites that describe various expectations of how it should handle Rust input. One of them is the [coverage test suite](https://rustc-dev-guide.rust-lang.org/tests/compiletest.html#coverage-tests) which contains a set of Rust inputs that is supposed to cover a wide range of Rust constructs. This test suite has been adapted to test hax.
142
+
143
+
We use the following methodology:
144
+
- The Rust inputs from the test suite have been copied to `rustc-coverage-tests/src/`, and can be updated using a script.
145
+
- A Rust crate structure is built around these source files, to allow hax to handle them. The files that fail `cargo check` are excluded. There are currently 26 excluded (out of 81) tests, mostly because they contain asynchronous code, which requires a runtime file that is missing in our infrastructure.
146
+
- To test hax frontend, we run `cargo hax json`. If the command succeeds, the test is considered successful.
147
+
148
+
These tests aim at increasing the confidence in the ability of hax frontend to handle Rust inputs covering all of the language constructs. As of today, all tests are handled successfully by hax frontend. However we don't test any requirement on the output (see the following section for tests of hax frontend output quality).
149
+
150
+
### Rust printer testing
151
+
152
+
This method aims at testing the quality of hax frontend's output. It uses a tool that is under development that we call the Rust printer.
153
+
154
+
This tool (written in Rust) takes the output of hax frontend (a json file describing the content of a Rust crate), it imports it as an AST (similar to the hax engine AST), and then prints this AST in Rust syntax.
155
+
156
+
If the Rust code we get out of this tool is equivalent to the Rust code it was given as input, then this means hax frontend correctly extracted the input code without losing or altering any information.
157
+
158
+
There is no easy way of testing the full input/output equivalence so the methodology here is to test that the resulting code behaves the same as the input code with respect to relevant test cases.
159
+
160
+
This work is available in the `rust-printer` folder. In the `tests` subfolder, an input file is available with tests for all Rust constructs supported by the printer (currently functions and expressions). For now these tests pass after extracting and printing the file with hax frontend and the Rust printer. This means that for the Rust constructs covered by the printer and the test file, hax frontend's extraction is correct. However this still needs to be extended to test more Rust constructs.
Copy file name to clipboardExpand all lines: docs/manual/quick_start/index.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
weight: 0
3
3
---
4
4
5
-
# Quick start with hax and F*
5
+
# Quick start with hax and F\*
6
6
7
7
Do you want to try hax out on a Rust crate of yours? This chapter is
8
8
what you are looking for!
@@ -11,7 +11,7 @@ what you are looking for!
11
11
12
12
- <inputtype="checkbox"class="user-checkable"/> [Install the hax toolchain](https://github.com/hacspec/hax?tab=readme-ov-file#installation).
13
13
<spanstyle="margin-right:30px;"></span>🪄 Running `cargo hax --version` should print some version info.
14
-
- <inputtype="checkbox"class="user-checkable"/> [Install F*](https://github.com/FStarLang/FStar/blob/master/INSTALL.md)*(optional: only if want to run F\*)*
14
+
- <inputtype="checkbox"class="user-checkable"/> [Install F\*](https://github.com/FStarLang/FStar/blob/master/INSTALL.md)*(optional: only if want to run F\*)*
15
15
16
16
## Setup the crate you want to verify
17
17
@@ -34,7 +34,7 @@ what you are looking for!
34
34
specific crate you want to extract.*
35
35
36
36
Run the command `cargo hax into fstar` to extract every item of your
37
-
crate as F* modules in the subfolder `proofs/fstar/extraction`.
37
+
crate as F\* modules in the subfolder `proofs/fstar/extraction`.
38
38
39
39
**What is critical? What is worth verifying?**
40
40
Probably, your Rust crate contains mixed kinds of code: some parts are
@@ -68,22 +68,22 @@ about the `-i` flag [in the FAQ](../faq/include-flags.md).
68
68
69
69
70
70
71
-
## Start F* verification
71
+
## Start F\* verification
72
72
After running the hax toolchain on your Rust code, you will end up
73
-
with various F* modules in the `proofs/fstar/extraction` folder. The
74
-
`Makefile` in `proofs/fstar/extraction` will run F*.
73
+
with various F\* modules in the `proofs/fstar/extraction` folder. The
74
+
`Makefile` in `proofs/fstar/extraction` will run F\*.
75
75
76
76
1.**Lax check:** the first step is to run `OTHERFLAGS="--lax" make`,
77
-
which will run F* in "lax" mode. The lax mode just makes sure basic
77
+
which will run F\* in "lax" mode. The lax mode just makes sure basic
78
78
typechecking works: it is not proving anything. This first step is
79
-
important because there might be missing libraries. If F* is not
79
+
important because there might be missing libraries. If F\* is not
80
80
able to find a definition, it is probably a `libcore` issue: you
81
-
probably need to edit the F* library, which lives in the
81
+
probably need to edit the F\* library, which lives in the
82
82
`proofs-libs` directory in the root of the hax repo.
83
-
2.**Typecheck:** the second step is to run `make`. This will ask F*
83
+
2.**Typecheck:** the second step is to run `make`. This will ask F\*
84
84
to typecheck fully your crate. This is very likely that you need to
85
85
add preconditions and postconditions at this stage. Indeed, this
86
-
second step is about panic freedom: if F* can typecheck your crate,
86
+
second step is about panic freedom: if F\* can typecheck your crate,
87
87
it means your code *never* panics, which already is an important
0 commit comments