Open mamonet opened 2 weeks ago
Thanks for the bug report Mamone!
I'm looking at it now, here is a minimized reproducer:
fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
}
}
The problem shows up only when n
is a &mut
.
Thanks for the issue! I spent a few hours on that, I don't have a fix yet.
I think this issue shows up mainly in functions that ends with a loop.
A workaround is to add a ()
at the end of the function, e.g.:
fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
}
}
becomes:
fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
};
()
}
There are cases where extracted F files in
libcrux-ml-kem
have redundant third return value where just double are supposed to be at the receiving side. This breaks lax-check of affected F files. Here is an example of this bug https://github.com/cryspen/libcrux/blob/dev/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ntt.fst#L34It's fixed manually here https://github.com/cryspen/libcrux/blob/dev_ml_kem_lax/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ntt.fst#L34