RFR: 8346107: Generators: testing utility for random value generation
Theo Weidmann
tweidmann at openjdk.org
Tue Jan 7 09:18:34 UTC 2025
This PR is a refactoring and partial rewrite of https://github.com/openjdk/jdk/pull/22716 by @eme64. The goals remain the same:
> For verification testing, it is often critical to generate "interesting" values, to provoke overflows, NaN, etc. And to generate these values in the correct distribution to trigger certain optimizations.
>
> I would like to start a collection of such generators, that can then be used in testing.
>
> The goal is to grow this collection in the future, and add new types. For example byte, char, short, or even Float16.
>
> This will be helpful for the Template framework [JDK-8344942](https://bugs.openjdk.org/browse/JDK-8344942), but also other tests.
>
> Related PR, for value verification: https://github.com/openjdk/jdk/pull/22715
The refactoring makes use of generics, rendering the generators library more flexible by default, by allowing it work with arbitrary types (with special features for Comparable types), improving the composability of different generators and streamlining the client API for simplicity. This allows test authors to quickly compose their own distributions and generators if necessary. An overview of this functionality is provided in the `Generators` javadoc.
-------------
Commit messages:
- Improve documentation
- Fix typo
- Add copyright
- Add new lines
- Improve documentation, naming, more restrictable
- Update SingleValueGenerator.java
- Delete patches.iml
- Implement most changes
- Some refactoring
- use Generators.Random, rm some imports
- ... and 6 more: https://git.openjdk.org/jdk/compare/28ae281b...36066fa6
Changes: https://git.openjdk.org/jdk/pull/22941/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22941&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8346107
Stats: 1816 lines in 21 files changed: 1816 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/22941.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22941/head:pull/22941
PR: https://git.openjdk.org/jdk/pull/22941
More information about the hotspot-compiler-dev
mailing list