-
Notifications
You must be signed in to change notification settings - Fork 81
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
Anomaly as a result of extraction in CertiCoq (assertion fails in ml code) #1072
Comments
I have to go back on my statement: |
That's an interesting report, will look into it! |
@mattam82 Did you have the chance to look into this? It's also blocking some other programs we'd like to extract. |
I've not had a chance yet. The usual suspect is lack of template-polymorphism, but it's unlikely to raise that error a priori. Maybe run_parse_module is using some fancy feature? It would be great if you could trace what |
Does it make sense to do opam install -y coq-wasm
cat > test_bug.v <<EOF
From Coq Require Import List.
From Coq.Strings Require Import Byte.
From CertiCoq.Plugin Require Import CertiCoq.
From Wasm Require Import binary_format_parser datatypes instantiation_func.
Definition test_bytes : list Byte.byte := x00 :: x61 :: x73 :: x6d :: x01 :: x00 :: x00 :: x00 :: nil.
Definition test_module : option module := run_parse_module test_bytes.
CertiCoq Compile test_module.
EOF
coqc -q test_bug.v |
This comment was marked as duplicate.
This comment was marked as duplicate.
I guess coqbot doesn't listen to comments on this repo, so running minimization at coq-community/run-coq-bug-minimizer#2 (comment) |
@mkarup what version of Coq are you using? There are no versions of coq-certicoq and coq-wasm on opam that are compatible with the same Coq versions. |
@JasonGross I reported this a while back, so I can't quite remember what the versions were at the time. For a version of coq-wasm that should be compatible with certicoq, you could try pinning coq-wasm to this commit (it is from a fork that we use for certicoq-wasm, specifically that commit). |
I've created a PR on opam for WasmCert-Coq that works with Coq 8.19 (which is a few commits ahead of the commit @mkarup has linked but nothing too different) -- hopefully this makes the debugging here slightly easier. |
Here is a somewhat reduced test-case, that depends only on the
|
I don't suppose there's a way to bypass |
And here's a version that depends only on
|
Here's a further reduced version that only depends on MetaCoq. Declare ML Module "coq-metacoq-erasure.plugin".
Inductive l (A : Type) : Type :=
| c : nat -> A -> l A.
Definition test := @c nat.
MetaCoq Erase test. |
The bug seems to be in eta expansion, |
Swapping the metacoq/template-coq/theories/EtaExpand.v Line 55 in c451d74
with the one in
fixes the issue in the minimized code. However, the original code still fails, the failure again looks to be due to eta expansion. |
I apologize if this is not the right place to report this, I admit I haven't investigated it thoroughly.
Using the CertiCoq project to try to extract the parsing of the binary representation of a WebAssembly module (using WasmCert-Coq), I encountered an "anomaly", and at a quick glance, it looked like it originated in one of the phases that MetaCoq is responsible for.
Again, I haven't investigated exactly what part of WasmCert that triggers this, so for now I leave this "minimal" example, and I will report back if I pinpoint it more accurately.
Error message:
Don't know if it even makes sense to include this, but the assertion failing code snippet in question is this:
The text was updated successfully, but these errors were encountered: