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

8264842: IGV: different nodes sharing idx are treated as equal #3593

Closed
wants to merge 4 commits into from

Conversation

@robcasloz
Copy link
Contributor

@robcasloz robcasloz commented Apr 20, 2021

This change replaces Node::_idx with a dedicated Node::_igv_idx as the internal node identifier for IGV. _igv_idx is unique across all phases in a compilation, which prevents IGV from wrongly treating unrelated nodes as if they were the same._igv_idx is proposed instead of Node::_debug_idx, which is also unique across phases, for stability (the _debug_idx identifiers of a compilation are affected by the entire compilation history) and flexibility (future enhancements such as JDK-8265587 require altering the node identifier in IGV-specific ways).

The following figure illustrates the effect of using _igv_idx instead of _idx as an internal node identifier. Using _idx (left), node 54 is wrongly treated as created in two different phases (two green circles in the graph snapshot view), whereas using _igv_idx (right), node 54 is shown as created once, as expected:

before-after-fix

At the IGV user interface level, this change encapsulates the internal node identifier by showing a "short node text" (configurable from Tools -> Options, defaulting to [idx] [name]) in all places where the internal identifier was exposed before: edge tooltips, slot tooltips, and the node search results. The code in ViewPanel.form and ViewPanel.java is generated by NetBeans 12.3 by editing ViewPanel.java in "Design" mode.

Testing

  • Regression-tested HotSpot changes on hs-tier1-3, windows-x64, linux-x64, linux-aarch64, and macosx-x64 (both release and debug).
  • Tested HotSpot graph generation and IGV graph loading and scheduling on tens of thousands of graphs by running java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4 ... on an instrumented IGV. Loading and scheduling are useful graph well-formedness tests, as they tend to fail for incorrect graphs, e.g. with repeated node identifiers.
  • Tested manually, for a few graphs, that nodes are treated as created exactly once by IGV (by selecting single nodes and checking that a single green circle appears in the graph snapshot view, as in the right screenshot above).
  • Tested manually that the new Short Node Text field in Tools -> Options is displayed and stored correctly, and that it is honored by edge tooltips, slot tooltips, and node search results (on Linux and Windows, for JDK 8, 11, and 15).

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8264842: IGV: different nodes sharing idx are treated as equal

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3593/head:pull/3593
$ git checkout pull/3593

Update a local copy of the PR:
$ git checkout pull/3593
$ git pull https://git.openjdk.java.net/jdk pull/3593/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3593

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3593.diff

robcasloz added 4 commits Apr 20, 2021
Encapsulate node identifiers by never showing them directly to the user.
Instead, introduce a 'Short Node Text' property that dictates which node
properties are shown in edge tooltips, slot tooltips, and node search bar.
'Short Node Text' has default value '[idx] [name]', and can be configured in
Tools -> Options. This encapsulation enables decoupling the C2 node identifiers
shown to the user (property 'idx') and internal node identifiers.
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 20, 2021

👋 Welcome back rcastanedalo! 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.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 20, 2021

@robcasloz The following labels will be automatically applied to this pull request:

  • build
  • hotspot-compiler

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

Loading

@robcasloz
Copy link
Contributor Author

@robcasloz robcasloz commented Apr 20, 2021

/label remove build

Loading

@openjdk openjdk bot removed the build label Apr 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 20, 2021

@robcasloz
The build label was successfully removed.

Loading

@robcasloz robcasloz marked this pull request as ready for review Apr 21, 2021
@openjdk openjdk bot added the rfr label Apr 21, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 21, 2021

Webrevs

Loading

@robcasloz
Copy link
Contributor Author

@robcasloz robcasloz commented Apr 21, 2021

This change has a side benefit: nodes that are renumbered by C2 (by calling Node::set_idx()) keep the same internal Node::_igv_idx value, and get treated as if they were the same node by IGV. This is illustrated in the following screenshot, where the selection of a graph subset is kept between "Incremental Boxing Inline" and "Before beautify loops" despite all nodes in the selection being renumbered (by PhaseRenumberLive::PhaseRenumberLive()):

before-after-renumbering

Preserving node equivalence in more complex transformations (matching) is proposed in a separate RFE (JDK-8265587).

Loading

Copy link
Contributor

@veresov veresov left a comment

LGTM

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 22, 2021

@robcasloz 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:

8264842: IGV: different nodes sharing idx are treated as equal

Introduce IGV-specific node identifier and encapsulate it in IGV by showing a
configurable 'short node text' string instead.

Reviewed-by: iveresov, kvn

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

  • 95f0fd6: 8265696: Move CDS sources to src/hotspot/shared/cds
  • a715b09: 8265798: Minimal build broken by JDK-8261090
  • 13d3263: 8265484: Fix up TRAPS usage in GenerateOopMap::compute_map and callers
  • a8ddbd1: 8265683: vmTestbase/nsk/jdb tests failed with "JDWP exit error AGENT_ERROR_INTERNAL(181)"
  • 7a55914: 8264196: Change link_and_cleanup_shared_classes(CATCH) to CHECK
  • b84f690: 8265793: Remove duplicate jtreg TEST.groups references for some client tests
  • 0e00598: 8265782: Bump bootjdk to jdk-17+19 on macosx-aarch64 at Oracle
  • e81baea: 8265786: ProblemList serviceability/sa/sadebugd/DisableRegistryTest.java on ZGC
  • ca0de26: 8265699: (bf) Scopes passed to ScopedMemoryAccess.copy[Swap]Memory in incorrect order
  • b930bb1: 8265461: G1: Forwarding pointer removal thread sizing
  • ... and 57 more: https://git.openjdk.java.net/jdk/compare/a25bae823979fc96d01a2e349506ed3b1ea39762...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.

Loading

@openjdk openjdk bot added the ready label Apr 22, 2021
@robcasloz
Copy link
Contributor Author

@robcasloz robcasloz commented Apr 23, 2021

Thanks for reviewing, Igor and Vladimir!

Loading

@robcasloz
Copy link
Contributor Author

@robcasloz robcasloz commented Apr 23, 2021

/summary
Introduce IGV-specific node identifier and encapsulate it in IGV by showing a
configurable 'short node text' string instead.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 23, 2021

@robcasloz Setting summary to:

Introduce IGV-specific node identifier and encapsulate it in IGV by showing a
configurable 'short node text' string instead.

Loading

@robcasloz
Copy link
Contributor Author

@robcasloz robcasloz commented Apr 23, 2021

/integrate

Loading

@openjdk openjdk bot closed this Apr 23, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 23, 2021

@robcasloz Since your change was applied there have been 67 commits pushed to the master branch:

  • 95f0fd6: 8265696: Move CDS sources to src/hotspot/shared/cds
  • a715b09: 8265798: Minimal build broken by JDK-8261090
  • 13d3263: 8265484: Fix up TRAPS usage in GenerateOopMap::compute_map and callers
  • a8ddbd1: 8265683: vmTestbase/nsk/jdb tests failed with "JDWP exit error AGENT_ERROR_INTERNAL(181)"
  • 7a55914: 8264196: Change link_and_cleanup_shared_classes(CATCH) to CHECK
  • b84f690: 8265793: Remove duplicate jtreg TEST.groups references for some client tests
  • 0e00598: 8265782: Bump bootjdk to jdk-17+19 on macosx-aarch64 at Oracle
  • e81baea: 8265786: ProblemList serviceability/sa/sadebugd/DisableRegistryTest.java on ZGC
  • ca0de26: 8265699: (bf) Scopes passed to ScopedMemoryAccess.copy[Swap]Memory in incorrect order
  • b930bb1: 8265461: G1: Forwarding pointer removal thread sizing
  • ... and 57 more: https://git.openjdk.java.net/jdk/compare/a25bae823979fc96d01a2e349506ed3b1ea39762...master

Your commit was automatically rebased without conflicts.

Pushed as commit b3a319c.

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants