JDK-8295351 : java/lang/Float/Binary16Conversion.java fails with "Unexpected result of converting"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,os_x,windows
  • CPU: x86_64,aarch64
  • Submitted: 2022-10-14
  • Updated: 2022-12-14
  • Resolved: 2022-11-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b26Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8295379 :  
Description
The following test failed in the JDK20 CI:

java/lang/Float/Binary16Conversion.java

Here's a snippet from the log file:

#section:main
----------messages:(7/234)----------
command: main Binary16Conversion
reason: User specified action: run main Binary16Conversion 
started: Fri Oct 14 00:25:20 UTC 2022
Mode: agentvm
Agent id: 22
finished: Fri Oct 14 00:25:21 UTC 2022
elapsed time (seconds): 0.773
----------configuration:(14/1341)*----------

<snip>

----------System.out:(10/791)----------
Unexpected result of converting 0x1.1dff7ep30 to short. Expected 0x7bff got 0x7c00
Unexpected result of converting -0x1.1dff7ep30 to short. Expected 0xfbff got 0xfc00
Unexpected result of converting 0x1.1dff8p30 to short. Expected 0x7bff got 0x7c00
Unexpected result of converting -0x1.1dff8p30 to short. Expected 0xfbff got 0xfc00
Unexpected result of converting 0x1.1dff82p30 to short. Expected 0x7bff got 0x7c00
Unexpected result of converting -0x1.1dff82p30 to short. Expected 0xfbff got 0xfc00
Unexpected result of converting 0x1.1dff7ep30 to short. Expected 0x7bff got 0x7c00
Unexpected result of converting -0x1.1dff7ep30 to short. Expected 0xfbff got 0xfc00
Round-to-nearest violation on converting 0x1.0p0 to binary16 and back.
Different conversion of float value 0x1.0p1
----------System.err:(10/531)----------
java.lang.RuntimeException: 10 errors
	at Binary16Conversion.main(Binary16Conversion.java:47)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:1591)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 10 errors
Comments
The fix for this bug is integrated in jdk-20+26-1972.
28-11-2022

Changeset: 105d9d75 Author: Smita Kamath <svkamath@openjdk.org> Committer: Sandhya Viswanathan <sviswanathan@openjdk.org> Date: 2022-11-28 19:24:25 +0000 URL: https://git.openjdk.org/jdk/commit/105d9d75e84a46400f52fafda2ea00c99c14eaf0
28-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11301 Date: 2022-11-22 21:52:59 +0000
23-11-2022

[~kvn] Thanks, I will take a look at it.
17-10-2022

ILW = Conversion error of floats, single test, no workaround = HLH = P2
17-10-2022

[~svkamath] Please, look on this failure. It is regression after your latest changes. It reproduces easy with `-Xcomp -XX:-TieredCompilation` flags.
15-10-2022

Test passed after reverting JDK-8289552 changes
15-10-2022

[~alanb] - Thanks I was just going to suggest moving this to hotspot/compiler since it only fails in -Xcomp mode.
15-10-2022

It fails with -Xcomp -XX:CompileThreshold=100 -XX:-TieredCompilation but passing if the newly added intrinsics are disabled with -XX:DisableIntrinsic=_float16ToFloat,_floatToFloat16. So I assume related to JDK-8289552 so I will move to hotspot/compiler.
15-10-2022