Debian Codegraph @

test-suite/coq-makefile/timing-template/init.sh

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 #!/usr/bin/bashscip-shell filesystem . . `/usr/bin/bash`.
2
3 set -x
4 set -e
5
6 # native stack overflows too easily, see eg
7 # https://gitlab.com/coq/coq/-/jobs/3250939810
8 export COQEXTRAFLAGS='-native-compiler no'
9
10 . ../template/path-init.shscip-shell source . . `../template/path-init.sh`.
11
12 # reset MAKEFLAGS so that, e.g., `make -C test-suite -B coq-makefile` doesn't give us issues
13
14 MAKEFLAGS=
15
16
17 INFINITY="∞"
18 INFINITY_REPLACEMENT="+.%" # assume that if the before time is zero, we expected the time to increase
19
20 TO_SED_IN_BOTH=(
21 -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
22 -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
23 -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
24 -e s'/[0-9]*\.[0-9]*//g' # the precise timing numbers vary, so we strip them out
25 -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
26 -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
27 -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/rocq-prover/rocq/issues/5675#issuecomment-487378622
28 )
29
30 TO_SED_IN_PER_FILE=(
31 -e s'/ */ /g' # unclear whether this is actually needed for per-file timing; it's been here from the start
32 -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
33 -e s'/- ko/ko/g' # for small amounts of memory, signs can flip, so we remove mem signs
34 )
35
36 TO_SED_IN_PER_LINE=(
37 -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
38 -e s'/^ *//g' # the number of leading spaces can differ, e.g., as in the difference between ' 0m13.53s' vs '0m13.582s'
39 )