Closed JasonGross closed 4 years ago
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
@coqbot merge now
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
true | coqtop
opam install -y coq-fiat-crypto.dev
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize coq.dev
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Minimized File /home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-fiat-crypto.dev/src/Assembly/Symbolic.v (full log on GitHub Actions)
bug.log
)If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@coqbot minimize
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@coqbot minimize coq=dev
opam install -y coq-fiat-crypto.dev
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
@JasonGross, Minimized File /home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-fiat-crypto.dev/src/Assembly/Symbolic.v (full log on GitHub Actions)
bug.log
)If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
Oops, I guess I'm using the wrong Coq version here @coqbot minimize coq.dev
git clone git@github.com:meta-introspector/metacoq.git --branch=feature/ltac_debug
cd metacoq
git checkout 1bc110910d49e2bcf3f3eb111527d4be0d4ad0c7
opam install --deps-only coq-metacoq
make
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
@coqbot minimize coq.dev
set -ex
opam install -y --deps-only coq-metacoq
printf -- git clone https://github.com/meta-introspector/metacoq.git --branch=feature/ltac_debug
git clone https://github.com/meta-introspector/metacoq.git --branch=feature/ltac_debug
cd metacoq
git checkout 6c23b8f5649d7dc8f51bce9310a0b70a28607853
make
Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.
@JasonGross, Error: Could not minimize file (full log on GitHub Actions, cc @JasonGross)
If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross
).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.
Originally posted by @JasonGross in https://github.com/JasonGross/coq-tools/issues/216#issuecomment-2341583892
Let's see if I can reproduce @coqbot minimize coq.dev
#!/usr/bin/env bash
opam pin remove coq -y
opam pin add coq 'https://github.com/SkySkimmer/coq.git#test-minimizer-general-tycon' -y
cat <<EOF > bug.v
Require Coq.ZArith.ZArith.
Import Coq.micromega.Lia.
Import Coq.Arith.PeanoNat.
Import Coq.Lists.List.
Import ListNotations.
Module Import Nat.
Definition div_up a b := Nat.div (a + (b-1)) b.
Lemma div_up_range a b (H : b <> 0) : a <= div_up a b * b < a + b.
Admitted.
Lemma div_up_add_mod a b n:
(a mod n = 0)%nat ->
Nat.div_up (a + b) n =
(Nat.div_up a n + Nat.div_up b n)%nat.
Admitted.
Lemma div_up_exact_mod a b:
(b <> 0)%nat ->
(a mod b = 0)%nat ->
((Nat.div_up a b) * b = a)%nat.
Admitted.
Section Chunk.
Context [A : Type] (k : nat).
Implicit Types (bs ck xs ys : list A).
Fixpoint chunk' bs ck {struct bs} : list (list A).
Admitted.
Definition chunk bs := chunk' bs [].
Context (Hk : k <> 0).
Lemma nth_error_chunk bs i (Hi : i < div_up (length bs) k)
: nth_error (chunk bs) i = Some (firstn k (skipn (i*k) bs)).
Admitted.
Lemma length_chunk bs : length (chunk bs) = div_up (length bs) k.
Admitted.
Lemma length_chunk_app (l l' : list A) :
(length l mod k)%nat = 0%nat ->
length (chunk (l ++ l')) = length (chunk l ++ chunk l').
Admitted.
Lemma chunk_app : forall (l l': list A),
(length l mod k = 0)%nat ->
chunk (l ++ l') = chunk l ++ chunk l'.
Proof.
intros * Hmod.
eapply nth_ext with (d := []) (d' := []); [ | intros idx ].
- apply length_chunk_app; assumption.
- intros Hidx; eassert (Some _ = Some _) as HS; [ | injection HS; intros Hs; apply Hs ].
rewrite <- !nth_error_nth' by assumption.
rewrite <- !nth_error_nth' by (rewrite length_chunk_app in Hidx; eassumption).
assert (idx < length (chunk l) \/ length (chunk l) <= idx)%nat as [Hlt | Hge] by lia;
[ rewrite nth_error_app1 | rewrite nth_error_app2 ]; try eassumption.
all: rewrite !nth_error_chunk.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hlt by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hidx by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hge by assumption.
all: rewrite ?length_chunk, ?app_length, ?div_up_add_mod by assumption.
all: try lia.
all: pose proof Nat.div_up_range (length l) k ltac:(lia).
+ pose proof div_up_exact_mod (length l) k ltac:(lia) ltac:(lia).
rewrite !firstn_skipn_comm, !firstn_app.
replace (idx * k + k - length l)%nat with 0%nat by nia.
simpl; rewrite app_nil_r; reflexivity.
+ rewrite Nat.mul_sub_distr_r.
erewrite div_up_exact_mod by lia.
rewrite skipn_app, skipn_all2; [ reflexivity | nia ].
Qed.
EOF
coqc -q bug.v
@coqbot minimize coq.dev
set -ex
opam install -y --deps-only coq-metacoq
printf -- git clone https://github.com/meta-introspector/metacoq.git --branch=feature/ltac_debug
git clone https://github.com/meta-introspector/metacoq.git --branch=feature/ltac_debug
cd metacoq
git checkout 6c23b8f5649d7dc8f51bce9310a0b70a28607853
make
Let's see if I can reproduce @coqbot minimize coq.dev
#!/usr/bin/env bash
true | coqtop
coqc --version
opam pin remove coq -y
opam pin add coq 'https://github.com/SkySkimmer/coq.git#test-minimizer-general-tycon' -y
true | coqtop
coqc --version
cat <<EOF > bug.v
Require Coq.ZArith.ZArith.
Import Coq.micromega.Lia.
Import Coq.Arith.PeanoNat.
Import Coq.Lists.List.
Import ListNotations.
Module Import Nat.
Definition div_up a b := Nat.div (a + (b-1)) b.
Lemma div_up_range a b (H : b <> 0) : a <= div_up a b * b < a + b.
Admitted.
Lemma div_up_add_mod a b n:
(a mod n = 0)%nat ->
Nat.div_up (a + b) n =
(Nat.div_up a n + Nat.div_up b n)%nat.
Admitted.
Lemma div_up_exact_mod a b:
(b <> 0)%nat ->
(a mod b = 0)%nat ->
((Nat.div_up a b) * b = a)%nat.
Admitted.
Section Chunk.
Context [A : Type] (k : nat).
Implicit Types (bs ck xs ys : list A).
Fixpoint chunk' bs ck {struct bs} : list (list A).
Admitted.
Definition chunk bs := chunk' bs [].
Context (Hk : k <> 0).
Lemma nth_error_chunk bs i (Hi : i < div_up (length bs) k)
: nth_error (chunk bs) i = Some (firstn k (skipn (i*k) bs)).
Admitted.
Lemma length_chunk bs : length (chunk bs) = div_up (length bs) k.
Admitted.
Lemma length_chunk_app (l l' : list A) :
(length l mod k)%nat = 0%nat ->
length (chunk (l ++ l')) = length (chunk l ++ chunk l').
Admitted.
Lemma chunk_app : forall (l l': list A),
(length l mod k = 0)%nat ->
chunk (l ++ l') = chunk l ++ chunk l'.
Proof.
intros * Hmod.
eapply nth_ext with (d := []) (d' := []); [ | intros idx ].
- apply length_chunk_app; assumption.
- intros Hidx; eassert (Some _ = Some _) as HS; [ | injection HS; intros Hs; apply Hs ].
rewrite <- !nth_error_nth' by assumption.
rewrite <- !nth_error_nth' by (rewrite length_chunk_app in Hidx; eassumption).
assert (idx < length (chunk l) \/ length (chunk l) <= idx)%nat as [Hlt | Hge] by lia;
[ rewrite nth_error_app1 | rewrite nth_error_app2 ]; try eassumption.
all: rewrite !nth_error_chunk.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hlt by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hidx by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hge by assumption.
all: rewrite ?length_chunk, ?app_length, ?div_up_add_mod by assumption.
all: try lia.
all: pose proof Nat.div_up_range (length l) k ltac:(lia).
+ pose proof div_up_exact_mod (length l) k ltac:(lia) ltac:(lia).
rewrite !firstn_skipn_comm, !firstn_app.
replace (idx * k + k - length l)%nat with 0%nat by nia.
simpl; rewrite app_nil_r; reflexivity.
+ rewrite Nat.mul_sub_distr_r.
erewrite div_up_exact_mod by lia.
rewrite skipn_app, skipn_all2; [ reflexivity | nia ].
Qed.
EOF
coqc -q bug.v
Let's see if I can reproduce @coqbot minimize coq.dev
#!/usr/bin/env bash
true | coqtop
coqc --version
opam pin remove coq -y
opam pin add coq 'https://github.com/SkySkimmer/coq.git#test-minimizer-general-tycon' -y
true | coqtop
coqc --version
cat <<EOF > bug.v
Require Coq.ZArith.ZArith.
Import Coq.micromega.Lia.
Import Coq.Arith.PeanoNat.
Import Coq.Lists.List.
Import ListNotations.
Module Import Nat.
Definition div_up a b := Nat.div (a + (b-1)) b.
Lemma div_up_range a b (H : b <> 0) : a <= div_up a b * b < a + b.
Admitted.
Lemma div_up_add_mod a b n:
(a mod n = 0)%nat ->
Nat.div_up (a + b) n =
(Nat.div_up a n + Nat.div_up b n)%nat.
Admitted.
Lemma div_up_exact_mod a b:
(b <> 0)%nat ->
(a mod b = 0)%nat ->
((Nat.div_up a b) * b = a)%nat.
Admitted.
Section Chunk.
Context [A : Type] (k : nat).
Implicit Types (bs ck xs ys : list A).
Fixpoint chunk' bs ck {struct bs} : list (list A).
Admitted.
Definition chunk bs := chunk' bs [].
Context (Hk : k <> 0).
Lemma nth_error_chunk bs i (Hi : i < div_up (length bs) k)
: nth_error (chunk bs) i = Some (firstn k (skipn (i*k) bs)).
Admitted.
Lemma length_chunk bs : length (chunk bs) = div_up (length bs) k.
Admitted.
Lemma length_chunk_app (l l' : list A) :
(length l mod k)%nat = 0%nat ->
length (chunk (l ++ l')) = length (chunk l ++ chunk l').
Admitted.
Lemma chunk_app : forall (l l': list A),
(length l mod k = 0)%nat ->
chunk (l ++ l') = chunk l ++ chunk l'.
Proof.
intros * Hmod.
eapply nth_ext with (d := []) (d' := []); [ | intros idx ].
- apply length_chunk_app; assumption.
- intros Hidx; eassert (Some _ = Some _) as HS; [ | injection HS; intros Hs; apply Hs ].
rewrite <- !nth_error_nth' by assumption.
rewrite <- !nth_error_nth' by (rewrite length_chunk_app in Hidx; eassumption).
assert (idx < length (chunk l) \/ length (chunk l) <= idx)%nat as [Hlt | Hge] by lia;
[ rewrite nth_error_app1 | rewrite nth_error_app2 ]; try eassumption.
all: rewrite !nth_error_chunk.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hlt by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hidx by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hge by assumption.
all: rewrite ?length_chunk, ?app_length, ?div_up_add_mod by assumption.
all: try lia.
all: pose proof Nat.div_up_range (length l) k ltac:(lia).
+ pose proof div_up_exact_mod (length l) k ltac:(lia) ltac:(lia).
rewrite !firstn_skipn_comm, !firstn_app.
replace (idx * k + k - length l)%nat with 0%nat by nia.
simpl; rewrite app_nil_r; reflexivity.
+ rewrite Nat.mul_sub_distr_r.
erewrite div_up_exact_mod by lia.
rewrite skipn_app, skipn_all2; [ reflexivity | nia ].
Qed.
EOF
coqc -q bug.v
Let's see if I can reproduce @coqbot minimize coq.dev
#!/usr/bin/env bash
true | coqtop
coqc --version
opam pin remove coq -y
opam pin add coq 'https://github.com/SkySkimmer/coq.git#test-minimizer-general-tycon' -y
true | coqtop
coqc --version
cat <<EOF > bug.v
Require Coq.ZArith.ZArith.
Import Coq.micromega.Lia.
Import Coq.Arith.PeanoNat.
Import Coq.Lists.List.
Import ListNotations.
Module Import Nat.
Definition div_up a b := Nat.div (a + (b-1)) b.
Lemma div_up_range a b (H : b <> 0) : a <= div_up a b * b < a + b.
Admitted.
Lemma div_up_add_mod a b n:
(a mod n = 0)%nat ->
Nat.div_up (a + b) n =
(Nat.div_up a n + Nat.div_up b n)%nat.
Admitted.
Lemma div_up_exact_mod a b:
(b <> 0)%nat ->
(a mod b = 0)%nat ->
((Nat.div_up a b) * b = a)%nat.
Admitted.
Section Chunk.
Context [A : Type] (k : nat).
Implicit Types (bs ck xs ys : list A).
Fixpoint chunk' bs ck {struct bs} : list (list A).
Admitted.
Definition chunk bs := chunk' bs [].
Context (Hk : k <> 0).
Lemma nth_error_chunk bs i (Hi : i < div_up (length bs) k)
: nth_error (chunk bs) i = Some (firstn k (skipn (i*k) bs)).
Admitted.
Lemma length_chunk bs : length (chunk bs) = div_up (length bs) k.
Admitted.
Lemma length_chunk_app (l l' : list A) :
(length l mod k)%nat = 0%nat ->
length (chunk (l ++ l')) = length (chunk l ++ chunk l').
Admitted.
Lemma chunk_app : forall (l l': list A),
(length l mod k = 0)%nat ->
chunk (l ++ l') = chunk l ++ chunk l'.
Proof.
intros * Hmod.
eapply nth_ext with (d := []) (d' := []); [ | intros idx ].
- apply length_chunk_app; assumption.
- intros Hidx; eassert (Some _ = Some _) as HS; [ | injection HS; intros Hs; apply Hs ].
rewrite <- !nth_error_nth' by assumption.
rewrite <- !nth_error_nth' by (rewrite length_chunk_app in Hidx; eassumption).
assert (idx < length (chunk l) \/ length (chunk l) <= idx)%nat as [Hlt | Hge] by lia;
[ rewrite nth_error_app1 | rewrite nth_error_app2 ]; try eassumption.
all: rewrite !nth_error_chunk.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hlt by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hidx by assumption.
all: repeat rewrite ?length_chunk, ?app_length, ?div_up_add_mod in Hge by assumption.
all: rewrite ?length_chunk, ?app_length, ?div_up_add_mod by assumption.
all: try lia.
all: pose proof Nat.div_up_range (length l) k ltac:(lia).
+ pose proof div_up_exact_mod (length l) k ltac:(lia) ltac:(lia).
rewrite !firstn_skipn_comm, !firstn_app.
replace (idx * k + k - length l)%nat with 0%nat by nia.
simpl; rewrite app_nil_r; reflexivity.
+ rewrite Nat.mul_sub_distr_r.
erewrite div_up_exact_mod by lia.
rewrite skipn_app, skipn_all2; [ reflexivity | nia ].
Qed.
EOF
coqc -q bug.v
Testing https://github.com/MetaCoq/metacoq/issues/1072#issuecomment-2408706733 @coqbot minimize coq.8.17
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
@coqbot: minimize it