On Fri, 13 Mar 2026 12:31:32 GMT, Axel Boldt-Christmas <[email protected]> 
wrote:

>> Hi all,
>> 
>> In some rare cases, no abstract value classes are generated. This causes the 
>> statistics printer to divide by zero.
>> 
>> This change makes it such that at least one abstract class is generated 
>> (this is to ensure sufficient coverage) rather than band-aid fixing the 
>> symptom. When halfway through generation, the generator will nudge the next 
>> class to be abstract if no abstract value classes have been generated thus 
>> far.
>> 
>> I also added a quality of life seed print at the beginning of execution.
>> 
>> Testing: tier 1, 100 invocations of the generator on Linux x64. The 
>> originally failing seed passes.
>
> test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout/ValueRandomLayoutTest.java
>  line 82:
> 
>> 80:   public static void main(String[] args) throws Exception {
>> 81:       String seedProperty = "CLASS_GENERATION_SEED";
>> 82:       String seedString = System.getProperty(seedProperty);
> 
> We have `jdk.test.lib.Utils` which have a generalised concept for this.
> 
> `Utils.getRandomInstance();`
> 
> https://github.com/openjdk/valhalla/blob/5de772acbc9e63d22ac24a1c633ffd59e319a50b/test/lib/jdk/test/lib/Utils.java#L513-L526

That would look nicer. Would you be okay with it being a follow-up RFE?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2223#discussion_r2930978763

Reply via email to