Skip to content
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

8297294: compiler/c2/irTests/TestMulNodeIdealization.java failed compilation #11437

Closed

Conversation

vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented Nov 30, 2022

Given that the reported issue is intermittent I think we have two options here:

1 - change the most probable use of a non-deterministic data structure that could be provoking this bug, to a deterministic one
2 - change all uses of non-deterministic data structures

I first tried option 1 but TBH after going again to the code I can't find a clear suspect. I thought we had reduced the options for non-determinism in the inference engine to zero, rien, niente. But it seems like that's not the case. So I have gone for option 2.

Comments?
TIA


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8297294: compiler/c2/irTests/TestMulNodeIdealization.java failed compilation

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11437/head:pull/11437
$ git checkout pull/11437

Update a local copy of the PR:
$ git checkout pull/11437
$ git pull https://git.openjdk.org/jdk pull/11437/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11437

View PR using the GUI difftool:
$ git pr show -t 11437

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11437.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 30, 2022

👋 Welcome back vromero! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 30, 2022
@openjdk
Copy link

openjdk bot commented Nov 30, 2022

@vicente-romero-oracle The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the compiler compiler-dev@openjdk.org label Nov 30, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 30, 2022

Webrevs

@archiecobbs
Copy link
Contributor

So just to confirm: while clearly changing HashSet to LinkedHashSet is going to eliminate some non-determinism, it also fixes the actual compiler logic bug rather than "papering over" it, correct?

If not - then is more investigation warranted?

If so - then doesn't that imply that the code that invokes closure() contains an implicit assumption about the ordering of the elements of that returned Set? And if so, since that's a fairly subtle and suspicious assumption about a Set, shouldn't that assumption least be documented in a comment somewhere (or ideally, corrected by sorting the Set into a List or something)? Otherwise it seems a variant of this bug could easily crop up again.

@openjdk
Copy link

openjdk bot commented Nov 30, 2022

⚠️ @vicente-romero-oracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@vicente-romero-oracle
Copy link
Contributor Author

vicente-romero-oracle commented Nov 30, 2022

So just to confirm: while clearly changing HashSet to LinkedHashSet is going to eliminate some non-determinism, it also fixes the actual compiler logic bug rather than "papering over" it, correct?

If not - then is more investigation warranted?

If so - then doesn't that imply that the code that invokes closure() contains an implicit assumption about the ordering of the elements of that returned Set? And if so, since that's a fairly subtle and suspicious assumption about a Set, shouldn't that assumption least be documented in a comment somewhere (or ideally, corrected by sorting the Set into a List or something)? Otherwise it seems a variant of this bug could easily crop up again.

It is not clear that there is a compiler bug as the code is compiled sometimes and sometimes not. This patch is not claiming to fix the any bug as a compiler failure can't be reproduced, so IMO there is no compiler bug. All I want is to make the inference engine as deterministic as possible.

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

@vicente-romero-oracle 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:

8297294: compiler/c2/irTests/TestMulNodeIdealization.java failed compilation

Reviewed-by: mcimadamore

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 31 new commits pushed to the master branch:

  • c70d1e1: 8296710: Update to use jtreg 7.1
  • 4899d78: 8293294: Remove dead code in Parse::check_interpreter_type
  • 5459b11: 8297033: G1: Improve logging for Remembered Sets
  • c6156f9: 8297561: Redundant index check in String.offsetByCodePoints()
  • eec24aa: 8295350: JFR: Add stop methods for recording streams
  • 9430f3e: 8297934: [BACKOUT] Compiler should only use verified interface types for optimization
  • 2cb64a7: 8294943: Implement record patterns in enhanced for
  • fc9d419: 8297928: Update jdk.internal.javac.PreviewFeature.Feature to reflect JEP 432 and JEP 433
  • b60cce6: 8297118: Change IncompatibleClassChangeError to MatchException for exhaustive switch statements and switch expressions
  • cd77609: 8294278: ForkJoinPool.getAndAddPoolIds should use Unsafe.staticFieldBase
  • ... and 21 more: https://git.openjdk.org/jdk/compare/be4245e814cc29701cc425d8e66854e36eb3aef0...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 1, 2022
@vicente-romero-oracle
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

Going to push as commit 82031d3.
Since your change was applied there have been 38 commits pushed to the master branch:

  • 337ca10: 8297978: Exclude vmTestbase/nsk/stress/except/except012.java until 8297977 is fixed
  • 770ff5a: 8297215: Update libs tests to use @enablePreview
  • c69aa42: 8297968: Crash in PrintOptoAssembly
  • 5a5ced3: 8297830: aarch64: Make Address a discriminated union internally
  • 391599b: 8297313: Refactor APIs for calculating address of CDS archive heap regions
  • 0962957: 8297449: Update JInternalFrame Metal Border code
  • 9f94cbe: 8271519: java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java failed with "Total [200] - Expected [400]"
  • c70d1e1: 8296710: Update to use jtreg 7.1
  • 4899d78: 8293294: Remove dead code in Parse::check_interpreter_type
  • 5459b11: 8297033: G1: Improve logging for Remembered Sets
  • ... and 28 more: https://git.openjdk.org/jdk/compare/be4245e814cc29701cc425d8e66854e36eb3aef0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 1, 2022
@openjdk openjdk bot closed this Dec 1, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 1, 2022
@openjdk
Copy link

openjdk bot commented Dec 1, 2022

@vicente-romero-oracle Pushed as commit 82031d3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants