RFR: 8373722: [TESTBUG] compiler/vectorapi/TestVectorOperationsWithPartialSize.java fails intermittently

Xiaohong Gong xgong at openjdk.org
Thu Dec 25 01:20:57 UTC 2025


On Wed, 24 Dec 2025 14:54:33 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>>> Yeah, I'm trying to extend the value range to `1~3000`. The tests are still running... Since the result largely depends on the random values, I run this test `500` times on SVE/NEON/X86 machines respectively (**1500** times totally), and have not observed failure now. Is that fine to you? I will update the test once all tests pass. Thanks for looking at this change!
>> 
>> As with range `1~3000`, we may still see failures even with 1000ULP according to the following program, right?
>> 
>> 
>> class T {
>>   public static void main(String[] args) {
>> 
>>     float ROUNDING_ERROR_FACTOR_ADD = 1000.0f;
>> 
>>     Float a = 1.0f + (ROUNDING_ERROR_FACTOR_ADD + 1) * Math.ulp(1.0f);
>>     Float b = 3000.0f;
>> 
>>     Float expected = a + b - b;
>>     Float actual   = a + (b - b);
>> 
>>     float tolerance = Math.ulp(expected) * ROUNDING_ERROR_FACTOR_ADD;
>>     if (Math.abs(expected - actual) > tolerance) {
>>       System.out.println("Error: Out of tolerance!");
>>     }
>>   }
>> }
>
>> > Yeah, I'm trying to extend the value range to `1~3000`. The tests are still running... Since the result largely depends on the random values, I run this test `500` times on SVE/NEON/X86 machines respectively (**1500** times totally), and have not observed failure now. Is that fine to you? I will update the test once all tests pass. Thanks for looking at this change!
>> 
>> As with range `1~3000`, we may still see failures even with 1000ULP according to the following program, right?
>> 
>> ```java
>> class T {
>>   public static void main(String[] args) {
>> 
>>     float ROUNDING_ERROR_FACTOR_ADD = 1000.0f;
>> 
>>     Float a = 1.0f + (ROUNDING_ERROR_FACTOR_ADD + 1) * Math.ulp(1.0f);
>>     Float b = 3000.0f;
>> 
>>     Float expected = a + b - b;
>>     Float actual   = a + (b - b);
>> 
>>     float tolerance = Math.ulp(expected) * ROUNDING_ERROR_FACTOR_ADD;
>>     if (Math.abs(expected - actual) > tolerance) {
>>       System.out.println("Error: Out of tolerance!");
>>     }
>>   }
>> }
>> ```
> 
> Oops, if the range is `1~3000`, there is no negative float, so the above program should not happen.
> Just ignore it.

Yes, that's why I didn't use negative values in the tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28960#discussion_r2646402566


More information about the hotspot-compiler-dev mailing list