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

coq_makefile timing tests are too fragile #5675

Closed
coqbot opened this issue Jul 31, 2017 · 45 comments · Fixed by #5989 or #7154
Closed

coq_makefile timing tests are too fragile #5675

coqbot opened this issue Jul 31, 2017 · 45 comments · Fixed by #5989 or #7154
Assignees
Labels
help wanted kind: ci-failure Information about unexpected and random CI failures. part: tools Coqdoc, coq_makefile, etc.
Milestone

Comments

@coqbot
Copy link
Contributor

coqbot commented Jul 31, 2017

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#5675
From: @maximedenes
Reported version: 8.8+alpha
CC: coq-bugs-redist@lists.gforge.inria.fr

@coqbot
Copy link
Contributor Author

coqbot commented Jul 31, 2017

Comment author: @maximedenes

Sometimes, tests measure a time of 0.00s, which leads to something like:

After    | File Name | Before   || Change    | % Change 
--------------------------------------------------------
0m00.95s | Total     | 0m00.03s || +0m00.92s | +3066.66%
--------------------------------------------------------
0m00.78s | Slow      | 0m00.00s || +0m00.78s | ∞

The infinity symbol is not recognized by the regexp, and the test fails.

@coqbot
Copy link
Contributor Author

coqbot commented Jul 31, 2017

Comment author: @JasonGross

Would it be sufficient to replace ∞ with the right string (is it .%, or %, or something like that)?

@coqbot
Copy link
Contributor Author

coqbot commented Oct 11, 2017

Comment author: @maximedenes

Jason, could you have a look at this one? These random failures are annoying.

An example here:

https://ci.appveyor.com/project/coq/coq/build/master~451/job/nsa1a0712407yijj

Thanks!

@maximedenes
Copy link
Member

@JasonGross ping

@ejgallego
Copy link
Member

This is destroying my workflow. Can we please disable this on master until the issue is solved?

@Zimmi48 Zimmi48 added this to Non-deterministic test-suite files in Fix non-deterministic tests Oct 19, 2017
JasonGross added a commit to JasonGross/coq that referenced this issue Oct 19, 2017
@Zimmi48 Zimmi48 added this to the 8.7.1 milestone Oct 20, 2017
Zimmi48 pushed a commit to Zimmi48/coq that referenced this issue Oct 20, 2017
This should (hopefully) fix coq#5675.

(cherry picked from commit 2f4b474)
@ejgallego
Copy link
Member

Still the tests always fail when make -j N and N large.

+++ time-of-build-both.log.processed    2017-10-20 21:34:43.508528975 +0200
@@ -2,5 +2,5 @@
 ------
 m.s | Total | m.s || +m.s | +.%
 ------
-m.s | Slow | m.s || +m.s | +.%
 m.s | Fast | m.s || -m.s | -.%
+m.s | Slow | m.s || +m.s | +.%
==========> FAILURE <==========

@ejgallego ejgallego reopened this Oct 20, 2017
@ejgallego
Copy link
Member

This is really a pain for me. Can we make these tests optional until the issue is fixed? I'll submit a PR, thanks.

@JasonGross
Copy link
Member

@ejgallego if you replace all + with -, in the sed script, is that enough to fix it? (I'm not at a computer right now to make that PR, but feel free to yourself; that way we'll still be testing that the scripts don't fail. Feel free to also pipe the output through sort if you need to.)

@ejgallego
Copy link
Member

if you replace all + with -, in the sed script, is that enough to fix it?

Note that the lines are swapped, will that help?

Feel free to also pipe the output through sort if you need to

That looks more promising I think.

@Zimmi48
Copy link
Member

Zimmi48 commented Nov 14, 2017

Recent occurrences of this problem on AppVeyor, here and here. I don't know what changed to make them occur again (this issue seemed to have disappeared on our CI).

@SkySkimmer
Copy link
Contributor

SkySkimmer commented Nov 14, 2017

The first one seems to be just that the output has changed since coqdep is being run for all files at once in that PR.
I don't know about the second one.

@Zimmi48
Copy link
Member

Zimmi48 commented Nov 14, 2017

Ah well, the other one being related to the timing scripts, that might be a similar issue of the output having changed.

@JasonGross
Copy link
Member

Yes, the first one just needs an update in the output invoking coqdep.

The second one fails with

cp: cannot stat '../template/theories/sub/testsub.v': No such file or directory

which is an error message from template/init.sh. I have no idea why we have one script that both sets COQBIN so coq_makefile can run, and also does copying of some files. I also am not sure why it's failing here, but the first thing I'd do is look at the output of pwd in both the calling script and in template.sh...

@JasonGross
Copy link
Member

Without doing any debugging, I expect my most recent commit on #6149, d0da687, will fix the second issue, because it removes the directory-structure-mangling from the timing tests (and splits up template/init.sh into two files, one of which sets environment variables, and the other of which also does directory copying).

@Zimmi48
Copy link
Member

Zimmi48 commented Nov 17, 2017

Here is another example of random failures due to coq-makefile timing tests: https://travis-ci.org/Zimmi48/coq/jobs/303541424.

@JasonGross
Copy link
Member

@Zimmi48 That log confuses me, and looks like it might actually be a bug in the scripts somewhere. Alas, the log doesn't contain enough info for me to diagnose, so I'm submitting a PR to have the log give more info.

JasonGross added a commit to JasonGross/coq that referenced this issue Nov 17, 2017
This should help debug things like
coq#5675 (comment) if they
ever show up again.
ejgallego pushed a commit to ejgallego/coq that referenced this issue Nov 22, 2017
This should help debug things like
coq#5675 (comment) if they
ever show up again.
@SkySkimmer
Copy link
Contributor

Example failure since the printing change https://gitlab.com/SkySkimmer/coq/-/jobs/43401950/artifacts/download

@Zimmi48 Zimmi48 closed this as completed Feb 28, 2018
@Zimmi48
Copy link
Member

Zimmi48 commented Mar 26, 2018

This happened again!
https://travis-ci.org/coq/coq/jobs/357456966#L6039

@Zimmi48 Zimmi48 reopened this Mar 26, 2018
@Zimmi48 Zimmi48 removed this from the 8.8+beta1 milestone Mar 26, 2018
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 2, 2018
This fixes coq#5675 (in yet another way).

This handles the issue that is displayed in
```
cat A.v.timing.diff
After     | Code                                                | Before    || Change    | % Change
---------------------------------------------------------------------------------------------------
0m01.44s  | Total                                               | 0m01.56s  || -0m00.12s | -7.92%
---------------------------------------------------------------------------------------------------
0m00.609s | Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] | 0m00.627s || -0m00.01s | -2.87%
0m00.527s | Chars 069 - 162 [Definition~foo0~:=~Eval~comp~i...] | 0m00.552s || -0m00.02s | -4.52%
0m00.304s | Chars 000 - 026 [Require~Coq.ZArith.BinInt.]        | 0m00.379s || -0m00.07s | -19.78%
   N/A    | Chars 027 - 068 [Declare~Reduction~comp~:=~nati...] | 0m00.006s || -0m00.00s | -100.00%
0m00.s    | Chars 027 - 068 [Declare~Reduction~comp~:=~vm_c...] |    N/A    || +0m00.00s | N/A
--- A.v.timing.diff.desired.processed	2018-03-23 22:22:19.000000000 +0000
+++ A.v.timing.diff.processed	2018-03-23 22:22:19.000000000 +0000
@@ -1,4 +1,4 @@
- N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | N/A
+ N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | -%
 ------
 ------
 After | Code | Before || Change | % Change
```
where, because `Declare Reduction` takes 0.006s rather than 0s, the %
change shows up as -100% rather than N/A.
JasonGross added a commit to JasonGross/coq that referenced this issue Apr 2, 2018
This fixes coq#5675 (in yet another way).

The issue was that `$` (end of string regex) was not properly escaped in
`"`s.

This handles the issue that is displayed in
```
cat A.v.timing.diff
After     | Code                                                | Before    || Change    | % Change
---------------------------------------------------------------------------------------------------
0m01.44s  | Total                                               | 0m01.56s  || -0m00.12s | -7.92%
---------------------------------------------------------------------------------------------------
0m00.609s | Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] | 0m00.627s || -0m00.01s | -2.87%
0m00.527s | Chars 069 - 162 [Definition~foo0~:=~Eval~comp~i...] | 0m00.552s || -0m00.02s | -4.52%
0m00.304s | Chars 000 - 026 [Require~Coq.ZArith.BinInt.]        | 0m00.379s || -0m00.07s | -19.78%
   N/A    | Chars 027 - 068 [Declare~Reduction~comp~:=~nati...] | 0m00.006s || -0m00.00s | -100.00%
0m00.s    | Chars 027 - 068 [Declare~Reduction~comp~:=~vm_c...] |    N/A    || +0m00.00s | N/A
--- A.v.timing.diff.desired.processed	2018-03-23 22:22:19.000000000 +0000
+++ A.v.timing.diff.processed	2018-03-23 22:22:19.000000000 +0000
@@ -1,4 +1,4 @@
- N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | N/A
+ N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | -%
 ------
 ------
 After | Code | Before || Change | % Change
```
where, because `Declare Reduction` takes 0.006s rather than 0s, the %
change shows up as -100% rather than N/A.
@JasonGross
Copy link
Member

I figured it out. The issue is that in

-e s":|\s*N/A\s*$:| ${INFINITY_REPLACEMENT}:g"

the first $ is not properly escaped.

JasonGross added a commit to JasonGross/coq that referenced this issue Apr 2, 2018
This fixes coq#5675 (in yet another way).

The issue was that `$` (end of string regex) was not properly escaped in
`"`s.

This handles the issue that is displayed in
```
cat A.v.timing.diff
After     | Code                                                | Before    || Change    | % Change
---------------------------------------------------------------------------------------------------
0m01.44s  | Total                                               | 0m01.56s  || -0m00.12s | -7.92%
---------------------------------------------------------------------------------------------------
0m00.609s | Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] | 0m00.627s || -0m00.01s | -2.87%
0m00.527s | Chars 069 - 162 [Definition~foo0~:=~Eval~comp~i...] | 0m00.552s || -0m00.02s | -4.52%
0m00.304s | Chars 000 - 026 [Require~Coq.ZArith.BinInt.]        | 0m00.379s || -0m00.07s | -19.78%
   N/A    | Chars 027 - 068 [Declare~Reduction~comp~:=~nati...] | 0m00.006s || -0m00.00s | -100.00%
0m00.s    | Chars 027 - 068 [Declare~Reduction~comp~:=~vm_c...] |    N/A    || +0m00.00s | N/A
--- A.v.timing.diff.desired.processed	2018-03-23 22:22:19.000000000 +0000
+++ A.v.timing.diff.processed	2018-03-23 22:22:19.000000000 +0000
@@ -1,4 +1,4 @@
- N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | N/A
+ N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | -%
 ------
 ------
 After | Code | Before || Change | % Change
```
where, because `Declare Reduction` takes 0.006s rather than 0s, the %
change shows up as -100% rather than N/A.
@Zimmi48 Zimmi48 added this to the 8.8.0 milestone Apr 4, 2018
@Zimmi48
Copy link
Member

Zimmi48 commented Apr 9, 2018

@ejgallego
Copy link
Member

I am starting to think that this code is inherently fragile and is gonna need a full replacement.

Zimmi48 pushed a commit to Zimmi48/coq that referenced this issue Apr 10, 2018
This fixes coq#5675 (in yet another way).

The issue was that `$` (end of string regex) was not properly escaped in
`"`s.

This handles the issue that is displayed in
```
cat A.v.timing.diff
After     | Code                                                | Before    || Change    | % Change
---------------------------------------------------------------------------------------------------
0m01.44s  | Total                                               | 0m01.56s  || -0m00.12s | -7.92%
---------------------------------------------------------------------------------------------------
0m00.609s | Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] | 0m00.627s || -0m00.01s | -2.87%
0m00.527s | Chars 069 - 162 [Definition~foo0~:=~Eval~comp~i...] | 0m00.552s || -0m00.02s | -4.52%
0m00.304s | Chars 000 - 026 [Require~Coq.ZArith.BinInt.]        | 0m00.379s || -0m00.07s | -19.78%
   N/A    | Chars 027 - 068 [Declare~Reduction~comp~:=~nati...] | 0m00.006s || -0m00.00s | -100.00%
0m00.s    | Chars 027 - 068 [Declare~Reduction~comp~:=~vm_c...] |    N/A    || +0m00.00s | N/A
--- A.v.timing.diff.desired.processed	2018-03-23 22:22:19.000000000 +0000
+++ A.v.timing.diff.processed	2018-03-23 22:22:19.000000000 +0000
@@ -1,4 +1,4 @@
- N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | N/A
+ N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | -%
 ------
 ------
 After | Code | Before || Change | % Change
```
where, because `Declare Reduction` takes 0.006s rather than 0s, the %
change shows up as -100% rather than N/A.

(cherry picked from commit d768015)
@Zimmi48
Copy link
Member

Zimmi48 commented Apr 10, 2018

Yet another, very similar failure. We definitely need to reopen this:
https://travis-ci.org/coq/coq/jobs/364720830#L6222

@Zimmi48 Zimmi48 reopened this Apr 10, 2018
@Zimmi48 Zimmi48 removed this from the 8.8.0 milestone Apr 10, 2018
@Zimmi48
Copy link
Member

Zimmi48 commented Aug 27, 2018

New occurrence noticed by @MSoegtropIMC: https://travis-ci.org/coq/coq/jobs/420496623#L4830

@MSoegtropIMC MSoegtropIMC added the kind: ci-failure Information about unexpected and random CI failures. label Aug 27, 2018
@JasonGross
Copy link
Member

@Zimmi48 @MSoegtropIMC I am rather confused by this one. The diff

--- A.v.timing.diff.desired.processed	2018-08-25 14:16:28.000000000 +0000
+++ A.v.timing.diff.processed	2018-08-25 14:16:28.000000000 +0000
@@ -4,6 +4,6 @@
 After | Code | Before || Change | % Change
 ms | Chars - 26 [Require~CoqZArithBinInt] | ms || -ms | -%
 ms | Chars 163 - 28 [Definition~foo1~:=~Eval~comp~i] | ms || -ms | -%
-ms | Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c] | N/A || -ms | N/A
+ms | Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c] | N/A || -ms | -%
 ms | Chars 69 - 162 [Definition~foo~:=~Eval~comp~i] | ms || -ms | -%
 ms | Total | ms || -ms | -%

claims that A.v.timing.diff.desired.processed contains the line ms | Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c] | N/A || -ms | N/A, but this file is generated by running sed on a checked-in file (A.v.timing.diff.desired), and running that sed command locally on the checked in file does not result in such a line; the contents on my machine is

 N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | ms || -ms | -%
------
------
After | Code | Before || Change | % Change
ms | Chars - 26 [Require~CoqZArithBinInt] | ms || -ms | -%
ms | Chars 163 - 28 [Definition~foo1~:=~Eval~comp~i] | ms || -ms | -%
ms | Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c] | N/A || -ms | -%
ms | Chars 69 - 162 [Definition~foo~:=~Eval~comp~i] | ms || -ms | -%
ms | Total | ms || -ms | -%

In particular, the line

    -e s':|\s*N/A\s*$:| '"${INFINITY_REPLACEMENT}"':g' # Whether or not something shows up as N/A depends on whether a time registers as 0.s or as 0.001s, so we can't rely on this being consistent

is supposed to catch exactly this case, so I am baffled. This is the case with both https://travis-ci.org/coq/coq/jobs/364720830#L6222 and https://travis-ci.org/coq/coq/jobs/420496623#L4830. #7154 fixed a related thing (at least have fixed it locally)......

@ejgallego
Copy link
Member

Has this been fixed?

@Zimmi48
Copy link
Member

Zimmi48 commented Mar 5, 2019

I don't remember seeing a recent occurrence. Let's close this in a few weeks if we don't report new occurrences in the meantime.

@Zimmi48
Copy link
Member

Zimmi48 commented Apr 28, 2019

New occurrence in: https://gitlab.com/coq/coq/-/jobs/203628478

Test file log:

+ set -e
++ dirname ./run.sh
+ cd .
++ cd ../../../..
++ pwd
+ COQLIB=/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source
+ export COQLIB
+ ./001-correct-diff-sorting-order/run.sh
+ set -e
++ dirname ./001-correct-diff-sorting-order/run.sh
+ cd ./001-correct-diff-sorting-order
+ /builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/tools/make-both-time-files.py time-of-build-after.log.in time-of-build-before.log.in time-of-build-both.log
+ diff -u time-of-build-both.log.expected time-of-build-both.log
+ ./002-single-file-sorting/run.sh
+ set -e
++ dirname ./002-single-file-sorting/run.sh
+ cd ./002-single-file-sorting
+ /builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/tools/make-one-time-file.py time-of-build.log.in time-of-build-pretty.log
+ diff -u time-of-build-pretty.log.expected time-of-build-pretty.log
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/error'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/error'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/error'
COQDEP VFILES
COQC A.v
File "./A.v", line 1, characters 10-11:
Error: The term "I" has type "True" which should be Set, Prop or Type.

Command exited with non-zero status 1
A (real: 0.09, user: 0.04, sys: 0.04, mem: 46888 ko)
make[6]: *** [Makefile:658: A.vo] Error 1
make[5]: *** [Makefile:320: all] Error 2
rm: cannot remove 'pretty-timed-success.ok': No such file or directory
make[4]: *** [Makefile:335: make-pretty-timed] Error 1
make[3]: *** [Makefile:355: pretty-timed] Error 2
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/error'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/aggregate'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/aggregate'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/aggregate'
COQDEP VFILES
COQC Slow.v
Slow (real: 1.65, user: 0.64, sys: 1.01, mem: 384908 ko)
COQC Fast.v
Fast (real: 0.20, user: 0.05, sys: 0.14, mem: 45848 ko)
Time     | File Name
--------------------
0m00.69s | Total    
--------------------
0m00.64s | Slow     
0m00.05s | Fast     make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/aggregate'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/before'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/before'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/before'
COQDEP VFILES
COQC Slow.v
Slow (real: 2.68, user: 1.07, sys: 1.16, mem: 384904 ko)
COQC Fast.v
Fast (real: 0.48, user: 0.08, sys: 0.22, mem: 45844 ko)
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/before'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
COQDEP VFILES
COQC Slow.v
Slow (real: 1.04, user: 0.07, sys: 0.35, mem: 45844 ko)
COQC Fast.v
Fast (real: 3.81, user: 1.26, sys: 1.80, mem: 384900 ko)
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
After    | File Name | Before   || Change    | % Change 
--------------------------------------------------------
0m01.33s | Total     | 0m01.15s || +0m00.17s | +15.65%  
--------------------------------------------------------
0m01.26s | Fast      | 0m00.08s || +0m01.17s | +1474.99%
0m00.07s | Slow      | 0m01.07s || -0m01.00s | -93.45%  make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
After    | File Name | Before   || Change    | % Change 
--------------------------------------------------------
0m01.33s | Total     | 0m01.15s || +0m00.17s | +15.65%  
--------------------------------------------------------
0m01.26s | Fast      | 0m00.08s || +0m01.17s | +1474.99%
0m00.07s | Slow      | 0m01.07s || -0m01.00s | -93.45%  make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/after'
cat time-of-build-before.log
COQDEP VFILES
COQC Slow.v
Slow (real: 2.68, user: 1.07, sys: 1.16, mem: 384904 ko)
COQC Fast.v
Fast (real: 0.48, user: 0.08, sys: 0.22, mem: 45844 ko)

cat time-of-build-after.log
COQDEP VFILES
COQC Slow.v
Slow (real: 1.04, user: 0.07, sys: 0.35, mem: 45844 ko)
COQC Fast.v
Fast (real: 3.81, user: 1.26, sys: 1.80, mem: 384900 ko)

cat time-of-build-both.log
After    | File Name | Before   || Change    | % Change 
--------------------------------------------------------
0m01.33s | Total     | 0m01.15s || +0m00.17s | +15.65%  
--------------------------------------------------------
0m01.26s | Fast      | 0m00.08s || +0m01.17s | +1474.99%
0m00.07s | Slow      | 0m01.07s || -0m01.00s | -93.45%  
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-before'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-before'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-before'
COQDEP VFILES
COQC A.v
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-before'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
CLEAN
CLEAN *.aux *.timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
COQDEP VFILES
COQC A.v
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
make[3]: Entering directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
PYTHON TIMING-DIFF A.v.before-timing
make[3]: Leaving directory '/builds/coq/coq/nix-build-coq.drv-0/glfrhpszzn5lmja09cil3riycjrqa1m1-source/test-suite/coq-makefile/timing/per-file-after'
cat A.v.before-timing
Chars 0 - 26 [Require~Coq.ZArith.BinInt.] 0.45 secs (0.262u,0.178s)
Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c...] 0. secs (0.u,0.s)
Chars 69 - 162 [Definition~foo0~:=~Eval~comp~i...] 1.423 secs (0.566u,0.599s)
Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] 1.728 secs (1.2u,0.454s)

cat A.v.after-timing
Chars 0 - 26 [Require~Coq.ZArith.BinInt.] 2.528 secs (0.334u,0.797s)
Chars 27 - 68 [Declare~Reduction~comp~:=~nati...] 0. secs (0.u,0.s)
Chars 69 - 162 [Definition~foo0~:=~Eval~comp~i...] 3.574 secs (0.514u,1.623s)
Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] 77.563 secs (2.743u,0.951s)

cat A.v.timing.diff
After     | Code                                                | Before    || Change    | % Change 
----------------------------------------------------------------------------------------------------
1m23.66s  | Total                                               | 0m03.60s  || +1m20.06s | +2223.38%
----------------------------------------------------------------------------------------------------
1m17.563s | Chars 163 - 208 [Definition~foo1~:=~Eval~comp~i...] | 0m01.728s || +1m15.83s | +4388.59%
0m03.574s | Chars 069 - 162 [Definition~foo0~:=~Eval~comp~i...] | 0m01.423s || +0m02.15s | +151.15% 
0m02.528s | Chars 000 - 026 [Require~Coq.ZArith.BinInt.]        | 0m00.45s  || +0m02.07s | +461.77% 
0m00.s    | Chars 027 - 068 [Declare~Reduction~comp~:=~nati...] |    N/A    || +0m00.00s | N/A      
   N/A    | Chars 027 - 068 [Declare~Reduction~comp~:=~vm_c...] | 0m00.s    || +0m00.00s | N/A      
--- A.v.timing.diff.desired.processed	2019-04-27 18:35:11.232176684 +0000
+++ A.v.timing.diff.processed	2019-04-27 18:35:11.220176752 +0000
@@ -1,9 +1,9 @@
  N/A | Chars 27 - 68 [Declare~Reduction~comp~:=~vm_c] | ms || -ms | -%
 ------
 ------
+1ms | Chars 163 - 28 [Definition~foo1~:=~Eval~comp~i] | ms || -1ms | -%
+1ms | Total | ms || -1ms | -%
 After | Code | Before || Change | % Change
 ms | Chars - 26 [Require~CoqZArithBinInt] | ms || -ms | -%
-ms | Chars 163 - 28 [Definition~foo1~:=~Eval~comp~i] | ms || -ms | -%
 ms | Chars 27 - 68 [Declare~Reduction~comp~:=~nati] | N/A || -ms | -%
 ms | Chars 69 - 162 [Definition~foo~:=~Eval~comp~i] | ms || -ms | -%
-ms | Total | ms || -ms | -%
==========> FAILURE <==========
    coq-makefile/timing/run.sh...Error!

@JasonGross
Copy link
Member

@Zimmi48, I'm not in front of a computer, but I think you can fix that one with:

 TO_SED_IN_PER_LINE=(
-    -e s'/0//g' # unclear whether this is actually needed above and beyond s'/[0-9]*\.[0-9]*//g'; it's been here from the start
+    -e s'/[0-9]//g' # sometimes the time is under 1 minute, sometimes it's over 1 minute, so we want to remove/normalize both instances; see https://github.com/coq/coq/issues/5675#issuecomment-487378622
     -e s'/  */ /g' # Sometimes 0 will show up as 0m00.s, sometimes it'll end up being more like 0m00.001s; we must strip out the spaces that result from left-aligning numbers of different widths based on how many digits Coq's [-time] gives
     )

@JasonGross
Copy link
Member

This is at

TO_SED_IN_PER_LINE=(

Feel free to combine this replacement rule with the one in TO_SED_IN_PER_FILE; then the diff is

 TO_SED_IN_BOTH=(
     -e s"/${INFINITY}/${INFINITY_REPLACEMENT}/g" # Whether or not something shows up as ∞ depends on whether a time registers as 0.s or as 0.001s, so we can't rely on this being consistent
     -e s':|\s*N/A\s*$:| '"${INFINITY_REPLACEMENT}"':g' # Whether or not something shows up as N/A depends on whether a time registers as 0.s or as 0.001s, so we can't rely on this being consistent
     -e s'/ *$//g' # the number of trailing spaces depends on how many digits percentages end up being; since this varies across runs, we remove trailing spaces
     -e s'/[0-9]*\.[0-9]*//g' # the precise timing numbers vary, so we strip them out
     -e s'/^-*$/------/g' # When none of the numbers get over 100 (or 1000, in per-file), the width of the table is different, so we normalize the number of dashes for table separators
     -e s'/+/-/g' # some code lines don't really change, but this can show up as either -0m00.01s or +0m00.01s, so we need to normalize the signs; additionally, some N/A's show up where we expect to get -∞ on the per-line file, and so the ∞-replacement gets the sign wrong, so we must correct it
+    -e s'/[0-9]//g' # sometimes the time is under 1 minute, sometimes it's over 1 minute, so we want to remove/normalize both instances; see https://github.com/coq/coq/issues/5675#issuecomment-487378622
 )
 
 TO_SED_IN_PER_FILE=(
-    -e s'/[0-9]//g' # unclear whether this is actually needed above and beyond s'/[0-9]*\.[0-9]*//g'; it's been here from the start
     -e s'/  */ /g' # unclear whether this is actually needed for per-file timing; it's been here from the start
     -e s'/\(Total.*\)-\(.*\)-/\1+\2+/g' # Overall time in the per-file timing diff should be around 0; if it comes out negative, we remove the sign
 )
 
 TO_SED_IN_PER_LINE=(
-    -e s'/0//g' # unclear whether this is actually needed above and beyond s'/[0-9]*\.[0-9]*//g'; it's been here from the start
     -e s'/  */ /g' # Sometimes 0 will show up as 0m00.s, sometimes it'll end up being more like 0m00.001s; we must strip out the spaces that result from left-aligning numbers of different widths based on how many digits Coq's [-time] gives
     )

@ejgallego
Copy link
Member

I think we can consider this fixed for now.

@Zimmi48 Zimmi48 added this to the 8.7.1 milestone Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted kind: ci-failure Information about unexpected and random CI failures. part: tools Coqdoc, coq_makefile, etc.
Projects
No open projects
Fix non-deterministic tests
Non-deterministic test-suite files
7 participants