-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double return bug #720
Comments
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 |
Thanks for the issue! I think this issue shows up mainly in functions that ends with a loop. fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
}
} becomes: fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
};
()
} |
@W95Psp this is overdue for a while now. What's the status and plan to get it fixed? |
I removed the due date and set the priority to low. We have a workaround, and loads of other things to do, so let's pick that whenever we have time. |
I found a few other instances of this. I think this has to have a higher priority since the bug and its fix are quite obscure. |
My reproducer: fn f(n: &mut usize) {
for _ in 0..10 {
*n += 1;
}
} works now, let's find another reproducer or close otherwise |
Looks like this is working for the cases in libcrux as well 🥳 |
Well, we did no any work towards this 😅 |
lets eliminate all instances in libcrux to test first
…On Thu, Nov 28, 2024, 09:44 Lucas Franceschino ***@***.***> wrote:
Well, we did no any work towards this 😅
Somehow something fixed it. I think that's one of the new phases added by
@maximebuyse <https://github.com/maximebuyse> that interact with this.
Shall we just close or shall we bisect to find out what fixed it?
—
Reply to this email directly, view it on GitHub
<#720 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFUVS5ZOTLID3DVFOJZ3CD2C3JX3AVCNFSM6AAAAABJJWJEOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBVGU2TKNBRGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm still seeing this in the ML-DSA code in libcrux. |
This is still generally broken. For example fn looping(array: &mut [u8; 5]) {
for i in 0..array.len() {
array[i] = i as u8;
}
} |
Fixed by #1223 |
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#L34
It'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
Workaround: add
()
at the end of your function, see the comment below.The text was updated successfully, but these errors were encountered: