-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 21, 23
-
b18
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8347079 | 21.0.7-oracle | Kavya K S | P4 | Resolved | Fixed | b01 |
JDK-8347592 | 21.0.7 | Goetz Lindenmaier | P4 | Resolved | Fixed | master |
JDK-8347080 | 17.0.15-oracle | Kavya K S | P4 | Resolved | Fixed | b01 |
Our tests (test/jdk/jdk/incubator/vector) now have a number of issues in their approach to use randomisation:
1. The seed for RNG is taken from a dedicated property, the 'jdk.test.lib.random.seed'. If the property is not set, a default value of 1337 is used. Effectively, that means that by default the tests do always run with the same value, which is unacceptable.
2. I see no reason against using the standard Utils.getRandomInstance (and @key randomness) there.
Superficially, the loopopts/superword/TestAlignVectorFuzzer.java presents a nice example.
3. Many tests create their own ad-hoc RNGs like this:
> int origin = (new java.util.Random()).nextInt(SPECIES.length());
> int part = (new java.util.Random()).nextInt(2);
I suggest to change all those occurrences to use the standard AbstractVectorTest.RAND field. Or Utils.getRandomInstance if the former is not handy enough.
1. The seed for RNG is taken from a dedicated property, the 'jdk.test.lib.random.seed'. If the property is not set, a default value of 1337 is used. Effectively, that means that by default the tests do always run with the same value, which is unacceptable.
2. I see no reason against using the standard Utils.getRandomInstance (and @key randomness) there.
Superficially, the loopopts/superword/TestAlignVectorFuzzer.java presents a nice example.
3. Many tests create their own ad-hoc RNGs like this:
> int origin = (new java.util.Random()).nextInt(SPECIES.length());
> int part = (new java.util.Random()).nextInt(2);
I suggest to change all those occurrences to use the standard AbstractVectorTest.RAND field. Or Utils.getRandomInstance if the former is not handy enough.
- backported by
-
JDK-8347079 Normalize Random usage by incubator vector tests
- Resolved
-
JDK-8347080 Normalize Random usage by incubator vector tests
- Resolved
-
JDK-8347592 Normalize Random usage by incubator vector tests
- Resolved
- links to
-
Commit openjdk/jdk/4bba445d
-
Commit(master) openjdk/jdk21u-dev/92171b8c
-
Review openjdk/jdk/18675
-
Review(master) openjdk/jdk17u-dev/3230
-
Review(master) openjdk/jdk21u-dev/1309
(3 links to)