Skip to content

Commit

Permalink
Keep submitted shootouts in a testable state (chapel-lang#23428)
Browse files Browse the repository at this point in the history
[trivial, not reviewed]

With so many submitted shootouts relying on deprecated features that
have now been removed, and so marked as `.notest` tests, we've lost the
ability to make sure we haven't lost performance, and the value of
keeping them in sync is reduced—particularly since we expect to submit
updated 2.0-compatible versions of the shootouts shortly after the
release. 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 existing features and
'use'-ing it at the end of the file to keep the clbg-diff's restricted
to one line, and the .good and .perfkeys files the same. This will
permit them to continue being tested until we have the chance to rewrite
them in the form that we intend to submit them as updates.
  • Loading branch information
bradcray authored Sep 17, 2023
2 parents 11a8a5f + 8495a75 commit 603c327
Show file tree
Hide file tree
Showing 31 changed files with 49 additions and 2 deletions.
21 changes: 21 additions & 0 deletions test/studies/shootout/submitted/Compat.chpl
Original file line number Diff line number Diff line change
@@ -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);
}
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/Compat.notest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compatability shim
10 changes: 10 additions & 0 deletions test/studies/shootout/submitted/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SRCS := $(wildcard *.chpl)
BINS = $(SRCS:%.chpl=%)

all: $(BINS)
echo $(SRCS)

%: %.chpl
chpl $<

.PHONY: Compat
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/fasta3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,4 @@ iter getRands(n) {
yield lastRand: real / IM;
}
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/fasta5.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,4 @@ proc getRands(n, arr) {
arr[i] = lastRand;
}
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/fasta6.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ inline proc getNextRand() {
lastRand = (lastRand * IA + IC) % IM;
return lastRand;
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/knucleotide3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ inline proc startsWithThree(data) {
data[3] == "H".toByte();
}

use Compat;
Empty file.
2 changes: 2 additions & 0 deletions test/studies/shootout/submitted/knucleotide4.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ record hashVal {
return val;
}
}

use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/mandelbrot.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ proc main() {
w.writef("%i %i\n", n, n);
w.write(image);
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/mandelbrot3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ inline operator >(xs, y) {
return false;
return true;
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/pidigits2.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ iter genDigits(numDigits) {
numer *= 10;
}
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/regexredux2.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ proc main(args: [] string) {
writeln(data.size);
writeln(copy.size);
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/regexredux3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ proc main(args: [] string) {
writeln(data.size);
writeln(copy.size);
}
use Compat;
Empty file.
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/revcomp3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ proc createTable() {

return table;
}
use Compat;
Empty file.
3 changes: 2 additions & 1 deletion test/studies/shootout/submitted/revcomp5.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -79,3 +79,4 @@ proc revcomp(ref buf, lo, hi) {
forall (i,j) in zip(lo..#(len/2), ..<hi by -1) do
(buf[i], buf[j]) = (cmpl[buf[j]], cmpl[buf[i]]);
}
use Compat;
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/revcomp5.good
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ revcomp5.chpl:22: warning: openfd is deprecated, please use the file initializer
revcomp5.chpl:22: warning: reader with a 'kind' argument is deprecated, please use Deserializers instead
revcomp5.chpl:24: warning: openfd is deprecated, please use the file initializer with a 'c_int' argument instead
revcomp5.chpl:24: warning: writer with a 'kind' argument is deprecated, please use Serializers instead
revcomp5.chpl:64: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit 'ref' intent for the argument 'buf'
revcomp5.chpl:64: In function 'revcomp':
revcomp5.chpl:71: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' forall intent for 'buf'
revcomp5.chpl:79: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' forall intent for 'buf'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion test/studies/shootout/submitted/revcomp5.perfkeys
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
real
verify:16666684:AACATTACAGGTAATGATAA
verify:16666685:AACATTACAGGTAATGATAA
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/revcomp8.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ proc findSeqStart(buff, inds, ref ltLoc) {
inline proc join(i: uint(16), j) {
return i << 8 | j;
}
use Compat;
Empty file.

0 comments on commit 603c327

Please sign in to comment.