Skip to content
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

Unreachable place in Rust AST on tvix/nix-compat - ImplExprPredNotFound #604

Closed
RaitoBezarius opened this issue Apr 12, 2024 · 7 comments
Closed
Labels
bug Something isn't working frontend Issue in the Rust to JSON translation

Comments

@RaitoBezarius
Copy link

Hi there,

I have been playing with the Aeneas pipeline for my own projects, notably as I am a Tvix developer (https://tvix.dev/), I was curious if I could extract some of the Nix utilities and pure algebra stuff to Lean.

After #579, I tested again and obtained this interesting trace: https://0x0.st/X-Q9.txt.

I guess the interesting error is the last one about the AST expectations being violated, unfortunately, I'm not sure having a repro will be easy, but I will look if it has a relationship with https://crates.io/crates/nom and whether I can figure out something.

Tvix can be found at: https://github.com/tvlfyi/tvix -- I tested this against the nix-compat crate.
My experimental branch for Aeneas & Hax: https://github.com/RaitoBezarius/hax/tree/experimentations & https://github.com/RaitoBezarius/charon/tree/experimentations.

@W95Psp W95Psp added bug Something isn't working frontend Issue in the Rust to JSON translation labels May 16, 2024
@W95Psp W95Psp changed the title Unreachable place in Rust AST on tvix/nix-compat Unreachable place in Rust AST on tvix/nix-compat - ImplExprPredNotFound May 16, 2024
@W95Psp
Copy link
Collaborator

W95Psp commented May 16, 2024

Hi, thanks for the bug report! (especially on a crate like tvix 😃 that's a very nice project!)

I looked a bit into that, tested on commit 52b9acd: running cargo hax json -k mir-built on this gives me the following output: https://gist.github.com/W95Psp/583b2072c8c702ea47b11a7105d8bfe7

Seems like the function definition fn parse_escaped_bstr(i: &[u8]) -> IResult<&[u8], BString> { is causing the bug (parser.rs line 15).
I guess that's nom's complexity hiding in IResult that yields an interesting bound. It is related to #474 and its fix #648, but also to PR #495 (which, sadly, doesn't fix that bug).

We should take some time to minimize here (by coming up with some explicit, simplier type instead of IResult<..>)

Copy link

github-actions bot commented Sep 1, 2024

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 1, 2024
@RaitoBezarius
Copy link
Author

Still a problem.

@github-actions github-actions bot removed the stale label Sep 3, 2024
@W95Psp W95Psp mentioned this issue Oct 2, 2024
4 tasks
@W95Psp
Copy link
Collaborator

W95Psp commented Oct 16, 2024

Hi, can you try to reproduce on main? I suspect #1008 fixed this issue.
I'm not able to test on my side, I've got errors related to rustc versions or something.

@W95Psp
Copy link
Collaborator

W95Psp commented Oct 23, 2024

Let's close, this should not be an issue any more.
If the bug is still there, please re open.

@W95Psp W95Psp closed this as completed Oct 23, 2024
@RaitoBezarius
Copy link
Author

RaitoBezarius commented Oct 23, 2024 via email

@W95Psp
Copy link
Collaborator

W95Psp commented Oct 23, 2024

No worries, thank you 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Issue in the Rust to JSON translation
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants