JDK-8332066 : AArch64: Math test failures since JDK-8331558
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 23
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2024-05-10
  • Updated: 2024-06-21
  • Resolved: 2024-05-10
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 23
23 b23Fixed
Related Reports
Relates :  
Relates :  
Description
jdk/java/lang/Math/WorstCaseTests.java:

----------System.err:(46/2223)----------
Failure for Math.sin:
	For input 2732187.3789284215	(0x1.4d84db080b9fdp21)
	got       0.6178199092364929	(0x1.3c52e421fa12ep-1);
	outside of range
	[0.7151013910092491	(0x1.6e21c4ff6aec3p-1), 0.7151013910092492	(0x1.6e21c4ff6aec4p-1)]
Failure for Math.sin:
	For input -1.5688582006686647E284	(-0x1.0e16eb809a35dp944)
	got       -0.5646576185311681	(-0x1.211acdaa0ea61p-1);
	outside of range
	[0.42762520798757	(0x1.b5e361ed01dacp-2), 0.42762520798757003	(0x1.b5e361ed01dadp-2)]
Failure for Math.sin:
	For input -3179953.848127983	(-0x1.842d8ec8f752fp21)
	got       0.2730791821693292	(0x1.17a211b28af3bp-2);
	outside of range
	[-0.7127105274607854	(-0x1.6ce864edeaffep-1), -0.7127105274607853	(-0x1.6ce864edeaffdp-1)]
Failure for Math.sin:
	For input -2.953588369689929E303	(-0x1.13a5ccd87c9bbp1008)
	got       0.30301735703415233	(0x1.364a2e9a54024p-2);
	outside of range
	[-0.5775420145973145	(-0x1.27b3964185d8ep-1), -0.5775420145973144	(-0x1.27b3964185d8dp-1)]
Failure for Math.cos:
	For input -2530533.2485504774	(-0x1.34e729fd08086p21)
	got       -0.8184050500150822	(-0x1.a305fc99645d1p-1);
	outside of range
	[0.7078403656014148	(0x1.6a6a0d6a17f0fp-1), 0.707840365601415	(0x1.6a6a0d6a17f1p-1)]
Failure for Math.cos:
	For input -2710576.3445649305	(-0x1.4ae182c1ab422p21)
	got       0.8966679866249208	(0x1.cb1810fbd930cp-1);
	outside of range
	[-0.7121293602644481	(-0x1.6c9c3831b6e3cp-1), -0.712129360264448	(-0x1.6c9c3831b6e3bp-1)]
Failure for Math.cos:
	For input -2530533.2485504774	(-0x1.34e729fd08086p21)
	got       -0.8184050500150822	(-0x1.a305fc99645d1p-1);
	outside of range
	[0.7078403656014148	(0x1.6a6a0d6a17f0fp-1), 0.707840365601415	(0x1.6a6a0d6a17f1p-1)]
Testing worst cases incurred 7 failures.
java.lang.RuntimeException
	at WorstCaseTests.main(WorstCaseTests.java:100)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1575)


******

hotspot/jtreg/compiler/intrinsics/math/Test8210461.java

----------System.out:(0/0)----------
----------System.err:(14/983)----------
java.lang.AssertionError: -0.6387044701761426 while expecting 0.7833030468809974
	at compiler.intrinsics.math.Test8210461.test(Test8210461.java:52)
	at java.base/java.util.Spliterators$DoubleArraySpliterator.forEachRemaining(Spliterators.java:1322)
	at java.base/java.util.stream.DoublePipeline$Head.forEach(DoublePipeline.java:629)
	at compiler.intrinsics.math.Test8210461.main(Test8210461.java:45)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1575)

JavaTest Message: Test threw exception: java.lang.AssertionError: -0.6387044701761426 while expecting 0.7833030468809974
JavaTest Message: shutting down test


**********

jdk/java/lang/Math/SinCosCornerCasesTests.java

<snip>
Failure for Math.cos:
	For input 1.7976931348623155E308	(0x1.ffffffffffffep1023)
	got       -0.5284048040909477	(-0x1.0e8b13113d648p-1);
	outside of range
	[0.37499230054232496	(0x1.7ffdfb4c5308fp-2), 0.374992300542325	(0x1.7ffdfb4c5309p-2)]
Failure for Math.cos:
	For input -1.7976931348623155E308	(-0x1.ffffffffffffep1023)
	got       -0.5284048040909477	(-0x1.0e8b13113d648p-1);
	outside of range
	[0.37499230054232496	(0x1.7ffdfb4c5308fp-2), 0.374992300542325	(0x1.7ffdfb4c5309p-2)]
Testing worst cases incurred 462 failures.
java.lang.RuntimeException
	at SinCosCornerCasesTests.main(SinCosCornerCasesTests.java:45)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1575)
Comments
This is effectively a backout of JDK-8331558, should have been recorded as such in the title. I'll go add some comments, now that that train had left the station.
13-05-2024

https://openjdk.org/guide/#backing-out-a-change
13-05-2024

Changeset: d215bc46 Author: Andrew Haley <aph@openjdk.org> Date: 2024-05-10 15:06:21 +0000 URL: https://git.openjdk.org/jdk/commit/d215bc46475b90abd898e995c1b4a6aa4b6cb024
10-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19177 Date: 2024-05-10 13:12:27 +0000
10-05-2024

Tests affected: compiler/intrinsics/math/Test8210461.java java/lang/Math/WorstCaseTests.java java/lang/Math/SinCosCornerCasesTests.java
10-05-2024

Problem is here: msubw(rscratch1, i, tmp5, rscratch1); // q0 = e0-24*(jv+1) macroAssembler_aarch64_trig.cpp:702 It's not, in general, safe to use rscratch1 in an msub macro. Suggest simply backing out JDK-8331558.
10-05-2024

On exactly what hardware?
10-05-2024