From 8495a75c8d46fb4cc62c9029f16dd0c7a157c648 Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Sun, 17 Sep 2023 08:33:21 -0700 Subject: [PATCH] Keep submitted shootouts passing testing With so many submitted shootouts relying on removed deprecated features and not passing testing, we lose the ability to make sure we haven't lost performance or features. This PR keeps the tests limping along, for now with minimal source changes from what was submitted, by adding a 'Compat' module that implements all missing features in terms of other features and 'use'-ing it at the end of the file to keep the diffs restricted to one line. This should permit them to continue being tested until we have the chance to rewrite them, ideally in a 2.0-compliant manner. --- Signed-off-by: Brad Chamberlain --- test/studies/shootout/submitted/Compat.chpl | 21 +++++++++++++++++++ test/studies/shootout/submitted/Compat.notest | 1 + test/studies/shootout/submitted/Makefile | 10 +++++++++ test/studies/shootout/submitted/fasta3.chpl | 1 + test/studies/shootout/submitted/fasta3.notest | 0 test/studies/shootout/submitted/fasta5.chpl | 1 + test/studies/shootout/submitted/fasta5.notest | 0 test/studies/shootout/submitted/fasta6.chpl | 1 + test/studies/shootout/submitted/fasta6.notest | 0 .../shootout/submitted/knucleotide3.chpl | 1 + .../shootout/submitted/knucleotide3.notest | 0 .../shootout/submitted/knucleotide4.chpl | 2 ++ .../shootout/submitted/knucleotide4.notest | 0 .../shootout/submitted/mandelbrot.chpl | 1 + .../shootout/submitted/mandelbrot.notest | 0 .../shootout/submitted/mandelbrot3.chpl | 1 + .../shootout/submitted/mandelbrot3.notest | 0 .../studies/shootout/submitted/pidigits2.chpl | 1 + .../shootout/submitted/pidigits2.notest | 0 .../shootout/submitted/regexredux2.chpl | 1 + .../shootout/submitted/regexredux2.notest | 0 .../shootout/submitted/regexredux3.chpl | 1 + .../shootout/submitted/regexredux3.notest | 0 test/studies/shootout/submitted/revcomp3.chpl | 1 + .../shootout/submitted/revcomp3.notest | 0 test/studies/shootout/submitted/revcomp5.chpl | 3 ++- test/studies/shootout/submitted/revcomp5.good | 1 + .../shootout/submitted/revcomp5.notest | 0 .../shootout/submitted/revcomp5.perfkeys | 2 +- test/studies/shootout/submitted/revcomp8.chpl | 1 + .../shootout/submitted/revcomp8.notest | 0 31 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 test/studies/shootout/submitted/Compat.chpl create mode 100644 test/studies/shootout/submitted/Compat.notest create mode 100644 test/studies/shootout/submitted/Makefile delete mode 100644 test/studies/shootout/submitted/fasta3.notest delete mode 100644 test/studies/shootout/submitted/fasta5.notest delete mode 100644 test/studies/shootout/submitted/fasta6.notest delete mode 100644 test/studies/shootout/submitted/knucleotide3.notest delete mode 100644 test/studies/shootout/submitted/knucleotide4.notest delete mode 100644 test/studies/shootout/submitted/mandelbrot.notest delete mode 100644 test/studies/shootout/submitted/mandelbrot3.notest delete mode 100644 test/studies/shootout/submitted/pidigits2.notest delete mode 100644 test/studies/shootout/submitted/regexredux2.notest delete mode 100644 test/studies/shootout/submitted/regexredux3.notest delete mode 100644 test/studies/shootout/submitted/revcomp3.notest delete mode 100644 test/studies/shootout/submitted/revcomp5.notest delete mode 100644 test/studies/shootout/submitted/revcomp8.notest diff --git a/test/studies/shootout/submitted/Compat.chpl b/test/studies/shootout/submitted/Compat.chpl new file mode 100644 index 000000000000..ed910baab132 --- /dev/null +++ b/test/studies/shootout/submitted/Compat.chpl @@ -0,0 +1,21 @@ +use IO, BigInteger, Regex; + +@deprecated("openfd is deprecated, please use the file initializer with a 'c_int' argument instead") +proc openfd(x) { + return new file(x); +} + +@deprecated("bigint.div_q using Round is deprecated, use the standalone function div with roundingMode instead") +proc ref bigint.div_q(x, y) { + div(this, x, y); +} + +@deprecated("'Regex.compile' is deprecated. Please use 'new regex()' instead.") +proc compile(x) { + return new regex(x); +} + +@deprecated("regex.sub is deprecated. Please use string.replace.") +proc regex.sub(x, y) { + return y.replace(this, x); +} \ No newline at end of file diff --git a/test/studies/shootout/submitted/Compat.notest b/test/studies/shootout/submitted/Compat.notest new file mode 100644 index 000000000000..1d35f87634ff --- /dev/null +++ b/test/studies/shootout/submitted/Compat.notest @@ -0,0 +1 @@ +Compatability shim diff --git a/test/studies/shootout/submitted/Makefile b/test/studies/shootout/submitted/Makefile new file mode 100644 index 000000000000..b0e7bcf18545 --- /dev/null +++ b/test/studies/shootout/submitted/Makefile @@ -0,0 +1,10 @@ +SRCS := $(wildcard *.chpl) +BINS = $(SRCS:%.chpl=%) + +all: $(BINS) + echo $(SRCS) + +%: %.chpl + chpl $< + +.PHONY: Compat diff --git a/test/studies/shootout/submitted/fasta3.chpl b/test/studies/shootout/submitted/fasta3.chpl index 6425e1b90a79..021e5225c2b3 100644 --- a/test/studies/shootout/submitted/fasta3.chpl +++ b/test/studies/shootout/submitted/fasta3.chpl @@ -154,3 +154,4 @@ iter getRands(n) { yield lastRand: real / IM; } } +use Compat; diff --git a/test/studies/shootout/submitted/fasta3.notest b/test/studies/shootout/submitted/fasta3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/fasta5.chpl b/test/studies/shootout/submitted/fasta5.chpl index 1d1167525a61..c5c9471b1092 100644 --- a/test/studies/shootout/submitted/fasta5.chpl +++ b/test/studies/shootout/submitted/fasta5.chpl @@ -173,3 +173,4 @@ proc getRands(n, arr) { arr[i] = lastRand; } } +use Compat; diff --git a/test/studies/shootout/submitted/fasta5.notest b/test/studies/shootout/submitted/fasta5.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/fasta6.chpl b/test/studies/shootout/submitted/fasta6.chpl index 3776d7a139f0..d13d375ea925 100644 --- a/test/studies/shootout/submitted/fasta6.chpl +++ b/test/studies/shootout/submitted/fasta6.chpl @@ -156,3 +156,4 @@ inline proc getNextRand() { lastRand = (lastRand * IA + IC) % IM; return lastRand; } +use Compat; diff --git a/test/studies/shootout/submitted/fasta6.notest b/test/studies/shootout/submitted/fasta6.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/knucleotide3.chpl b/test/studies/shootout/submitted/knucleotide3.chpl index f2f71ffe0ebb..9409170f2742 100644 --- a/test/studies/shootout/submitted/knucleotide3.chpl +++ b/test/studies/shootout/submitted/knucleotide3.chpl @@ -131,3 +131,4 @@ inline proc startsWithThree(data) { data[3] == "H".toByte(); } +use Compat; diff --git a/test/studies/shootout/submitted/knucleotide3.notest b/test/studies/shootout/submitted/knucleotide3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/knucleotide4.chpl b/test/studies/shootout/submitted/knucleotide4.chpl index 40ca7acbf45c..72439c6fc95e 100644 --- a/test/studies/shootout/submitted/knucleotide4.chpl +++ b/test/studies/shootout/submitted/knucleotide4.chpl @@ -137,3 +137,5 @@ record hashVal { return val; } } + +use Compat; diff --git a/test/studies/shootout/submitted/knucleotide4.notest b/test/studies/shootout/submitted/knucleotide4.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/mandelbrot.chpl b/test/studies/shootout/submitted/mandelbrot.chpl index bca3eec10bbd..32062cea2861 100644 --- a/test/studies/shootout/submitted/mandelbrot.chpl +++ b/test/studies/shootout/submitted/mandelbrot.chpl @@ -64,3 +64,4 @@ proc main() { w.writef("%i %i\n", n, n); w.write(image); } +use Compat; diff --git a/test/studies/shootout/submitted/mandelbrot.notest b/test/studies/shootout/submitted/mandelbrot.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/mandelbrot3.chpl b/test/studies/shootout/submitted/mandelbrot3.chpl index a10be035d1dc..5caca5751416 100644 --- a/test/studies/shootout/submitted/mandelbrot3.chpl +++ b/test/studies/shootout/submitted/mandelbrot3.chpl @@ -77,3 +77,4 @@ inline operator >(xs, y) { return false; return true; } +use Compat; diff --git a/test/studies/shootout/submitted/mandelbrot3.notest b/test/studies/shootout/submitted/mandelbrot3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/pidigits2.chpl b/test/studies/shootout/submitted/pidigits2.chpl index 0e7f06161356..c5e43a7cb820 100644 --- a/test/studies/shootout/submitted/pidigits2.chpl +++ b/test/studies/shootout/submitted/pidigits2.chpl @@ -68,3 +68,4 @@ iter genDigits(numDigits) { numer *= 10; } } +use Compat; diff --git a/test/studies/shootout/submitted/pidigits2.notest b/test/studies/shootout/submitted/pidigits2.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/regexredux2.chpl b/test/studies/shootout/submitted/regexredux2.chpl index 113cd5397680..babe6b41e41e 100644 --- a/test/studies/shootout/submitted/regexredux2.chpl +++ b/test/studies/shootout/submitted/regexredux2.chpl @@ -58,3 +58,4 @@ proc main(args: [] string) { writeln(data.size); writeln(copy.size); } +use Compat; diff --git a/test/studies/shootout/submitted/regexredux2.notest b/test/studies/shootout/submitted/regexredux2.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/regexredux3.chpl b/test/studies/shootout/submitted/regexredux3.chpl index 7b872bc6b648..49194a5a1e58 100644 --- a/test/studies/shootout/submitted/regexredux3.chpl +++ b/test/studies/shootout/submitted/regexredux3.chpl @@ -59,3 +59,4 @@ proc main(args: [] string) { writeln(data.size); writeln(copy.size); } +use Compat; diff --git a/test/studies/shootout/submitted/regexredux3.notest b/test/studies/shootout/submitted/regexredux3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/revcomp3.chpl b/test/studies/shootout/submitted/revcomp3.chpl index 0b712e36fb99..adeaeb609711 100644 --- a/test/studies/shootout/submitted/revcomp3.chpl +++ b/test/studies/shootout/submitted/revcomp3.chpl @@ -101,3 +101,4 @@ proc createTable() { return table; } +use Compat; diff --git a/test/studies/shootout/submitted/revcomp3.notest b/test/studies/shootout/submitted/revcomp3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/revcomp5.chpl b/test/studies/shootout/submitted/revcomp5.chpl index fe76e5857b2b..d1a17b1ee681 100644 --- a/test/studies/shootout/submitted/revcomp5.chpl +++ b/test/studies/shootout/submitted/revcomp5.chpl @@ -61,7 +61,7 @@ proc main(args: [] string) { } -proc revcomp(ref buf, lo, hi) { +proc revcomp(buf, lo, hi) { // shift all of the linefeeds into the right places const len = hi - lo + 1, off = (len - 1) % cols, @@ -79,3 +79,4 @@ proc revcomp(ref buf, lo, hi) { forall (i,j) in zip(lo..#(len/2), ..