RFR: 8346107: Generators: testing utility for random value generation [v22]

duke duke at openjdk.org
Thu Jan 16 09:27:53 UTC 2025


On Wed, 15 Jan 2025 11:34:10 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:

>> 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.
>
> Theo Weidmann has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 45 additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-8346107-Generators
>  - Update Generators.java
>  - Rename to powerOfTwos
>  - Update year
>  - Minor improvements
>  - Update test/hotspot/jtreg/compiler/lib/generators/Generators.java
>    
>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>  - Update test/hotspot/jtreg/compiler/lib/generators/Generators.java
>    
>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>  - Update test/hotspot/jtreg/compiler/lib/generators/Generators.java
>    
>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>  - Update test/hotspot/jtreg/compiler/lib/generators/Generators.java
>    
>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>  - Remove unnecessary type postfixes
>  - ... and 35 more: https://git.openjdk.org/jdk/compare/437a3e1a...da137fc2

@theoweidmannoracle 
Your change (at version da137fc2b35c44eacb3aede451b1ec8286ae47ae) is now ready to be sponsored by a Committer.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22941#issuecomment-2594989883


More information about the hotspot-compiler-dev mailing list