-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8365262: [IR-Framework] Add simple way to add cross-product of flags #26762
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
Conversation
👋 Welcome back mhaessig! A progress list of the required criteria for merging this PR into |
@mhaessig 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 63 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Thanks @mhaessig. Nice API improvement! I'm a bit unsure about the way it's tested though.
"-XX:TLABRefillWasteFraction=53", | ||
"-XX:TLABRefillWasteFraction=64")); | ||
t1.start(); | ||
Asserts.fail("Should have thrown exception"); |
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.
Hmmm, why do the tests fail? I'm wondering if a simpler way to test the functionality is possible that doesn't require having to figure out failure modes? Maybe some kind of positive test that counts number of test scenarios run?
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.
Except in the first run, all scenarios fail. That is the only way we currently have to count the scenarios we are executing.
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.
Looks good to me, I only have one minor suggestion.
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Benoît Maillard <[email protected]>
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Outdated
Show resolved
Hide resolved
Thank you for looking at this @eme64. I made the testing a bit more robust and added a case for a pair of arguments. |
|
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Show resolved
Hide resolved
@eme64, I completely revamped counting of failures to regex matching and made multiple and no flags in one string work. |
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.
Looks much better already! I now took a closer look at the implementation :)
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
Thank you for your detailed review, @eme64. I addressed all of your comments. |
Stream<List<String>> crossProduct = Arrays.stream(flagSets) | ||
.reduce( | ||
Stream.of(Collections.<String>emptyList()), | ||
(acc, set) -> | ||
acc.flatMap(list -> | ||
set.stream().map(element -> { | ||
List<String> newList = new ArrayList<>(list); | ||
newList.add(element); | ||
return newList; | ||
}) | ||
), | ||
(a, b) -> Stream.concat(a, b)); |
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.
Wow, that's dense. Maybe a little comment could help here.
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.
It ended up being a lottle comment, but I think it does the job.
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
Outdated
Show resolved
Hide resolved
Looks much better already with a few extra comments :) |
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.
Thanks for all the updates! It's going to make the tests just a little nicer 😊
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 new changes look good to me!
Thank you for your reviews, @benoitmaillard and @eme64! /integrate |
Going to push as commit 57df267.
Your commit was automatically rebased without conflicts. |
This PR adds the
TestFramework::addCrossProductScenarios
method to enable more ergonomic testing of the combination of all flag combinations. To illustrate its use, I also converted one test to use the new cross product functionality.Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26762/head:pull/26762
$ git checkout pull/26762
Update a local copy of the PR:
$ git checkout pull/26762
$ git pull https://git.openjdk.org/jdk.git pull/26762/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26762
View PR using the GUI difftool:
$ git pr show -t 26762
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26762.diff
Using Webrev
Link to Webrev Comment