-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8301833: Add wide-ranging tests for FDLIBM porting #12430
Conversation
👋 Welcome back darcy! A progress list of the required criteria for merging this PR into |
Webrevs
|
PS The manual test passes when run against a JDK 20 build, helping to validate the new-in-21 transliteration ports done so far in JDK 21 (log10, log1p, expm1). |
Manual tests are the tests of last resort :-) This test may be useful for the current transliteration work but it's not clear how this manual test would be run by someone tasked with running the manual tests. Right now, it looks like it's more of a long running stress test but I think the expectation is that someone running this test needs to do a special build or somehow compare results with an older JDK release. Have you explored alternatives to adding a manual test? Long running HotSpot stress tests run in higher tiers. For comparison, I'm wondering if samples could be captured in a golden file for the test to use. If we are adding a manual test here then I think it will need good instructions. @bwhuang-us has done work in recent times on making sure that the manual tests are in test groups with instructions. |
To add some quick background: the FDLIBM porting effort is now doing two ports per method:
These exhaustive tests are helpful now to provide another layer of checking to the transliteration port (by validating it against say, a JDK 20 build) and also helpful in the future to validate any implementation optimization to the idiomatic port when run against the transliteration port. The tests are long-running (one of the order of at least a minute or two per method under test) and in my estimation don't provide enough utility for their cost to be run all the time. However, they have much higher utility to help validate this initial port and for future refactorings. Therefore, I think these tests should be included in the repository, but not run all the time, which led me to declare them as a manual jtreg test. |
@AlanBateman Unknown command |
Manual tests are run at each release. There are a couple of examples in the repo with tests that don't have @test tags. There are easily forgotten but they have been useful in a few areas for cases like this where the maintainer wants something in the repo doesn't doesn't want it run by regular testing. If you do decide to make this a manual test then I think it will need instructions so that someone knows what to do. |
import java.util.function.DoubleBinaryOperator; | ||
import java.util.function.DoubleUnaryOperator; | ||
|
||
public class ExhaustingTests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great name!
private static long testUnaryMethods() { | ||
long failures = 0; | ||
UnaryTestCase[] testCases = { | ||
// new UnaryTestCase("sqrt", FdlibmTranslit::sqrt, StrictMath::sqrt), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not include the TBD cases as part of this initial PR?
@@ -86,6 +86,10 @@ public static double log1p(double x) { | |||
return Log1p.compute(x); | |||
} | |||
|
|||
public static double exp(double x) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps leave out of this PR any FdlibmTranslit
changes and later include ExhaustingTest
changes in each separate PR for the functions being ported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay; I'll roll the addition of the exp method into the PR for the hyperbolics since exp is used in the hyperbolics implementation.
Changed to the tests to by default just check every 1024th float value, which puts running the test into the usual tier 1 test time guidelines. Dedicated math library work can temporarily dial up the testing density for particular efforts. |
This look reasonable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks all right.
@jddarcy This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The move to make this an automated tests and test every 1024th float is good.
/integrate |
Going to push as commit 8049e59.
Your commit was automatically rebased without conflicts. |
To help add assurances that the main-line port of FDLIBM to Java is working correctly, added some long-running manual tests to probe that the transliteration port and the corresponding StrictMath method are in agreement on a large number of argument, say, all float values.
To test the transliteration port, this test can be run against a build where the JDK has not had the FDLIBM code used for StrictMath ported to Java.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12430/head:pull/12430
$ git checkout pull/12430
Update a local copy of the PR:
$ git checkout pull/12430
$ git pull https://git.openjdk.org/jdk pull/12430/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12430
View PR using the GUI difftool:
$ git pr show -t 12430
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12430.diff