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

8214761: Bug in parallel Kahan summation implementation #4674

Closed
wants to merge 7 commits into from

Conversation

igraves
Copy link
Member

@igraves igraves commented Jul 2, 2021


Progress

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

Issue

  • JDK-8214761: Bug in parallel Kahan summation implementation

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4674

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 2, 2021

👋 Welcome back igraves! 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
Copy link

openjdk bot commented Jul 2, 2021

@igraves The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review labels Jul 2, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 2, 2021

Webrevs

@theRealAph
Copy link
Contributor

theRealAph commented Jul 2, 2021

Crikey, how did we get that wrong?
It'd be nice if we had a regression test for this. Can you provide one, please?

sumWithCompensation(other.sumCompensation);

//Negating this value because low-order bits are in negated form
sumWithCompensation(-other.sumCompensation);
Copy link

@stefan-zobel stefan-zobel Jul 2, 2021

Choose a reason for hiding this comment

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

Wouldn't that be double tmp = sum - sumCompensation; in getSum() in line 246 too?

Copy link
Member Author

@igraves igraves Jul 6, 2021

Choose a reason for hiding this comment

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

Good catch will review and make the change.

@stefan-zobel
Copy link

stefan-zobel commented Jul 2, 2021

What about Collectors.computeFinalSum() - should this be double tmp = summands[0] + summands[1]; or double tmp = summands[0] - summands[1]; ?

@stefan-zobel
Copy link

stefan-zobel commented Jul 2, 2021

Crikey, how did we get that wrong?
It'd be nice if we had a regression test for this. Can you provide one, please?

I found this: https://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057239.html
Ivan Gerasimov already tackled this back then. His webrev still exists and it contains a simple regression test.

@igraves
Copy link
Member Author

igraves commented Jul 22, 2021

Circling back on this. I've worked in the test from Ivan Gerasimov's email back when. It includes some additional comparisons to prior approaches to assert improvements in error.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 19, 2021

@igraves This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Copy link
Member

@jddarcy jddarcy left a comment

The code changes look fine, but IMO the comments should be re-worded a bit.

Rather text like

// Negating this value because low-order bits are in negated form

I suggest something like

// Subtract compensation bits

The main compensation loop also subtracts the compensation bits. A comment like "subtract compensation bits" makes the corrected handling of them seem less anomalous.

@openjdk
Copy link

openjdk bot commented Aug 30, 2021

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

8214761: Bug in parallel Kahan summation implementation

Reviewed-by: darcy

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

  • 9689f61: 8272788: Nonleaf ranked locks should not be safepoint_check_never
  • 4ee0dac: 8273248: ProblemList java/lang/instrument/BootClassPath/BootClassPathTest.sh on all configs
  • 655ea6d: 8270489: Support archived heap objects in EpsilonGC
  • dacd197: 8273217: Make ParHeapInspectTask _safepoint_check_never
  • 02822e1: 8272377: assert preconditions that are ensured when created in add_final_edges
  • a58cf16: 8272563: assert(is_double_stack() && !is_virtual()) failed: type check
  • 0e14bf7: 8273176: handle latest VS2019 in abstract_vm_version
  • f1c5e26: 8273206: jdk/jfr/event/gc/collection/TestG1ParallelPhases.java fails after JDK-8159979
  • e600fe1: 8272618: Unnecessary Attr.visitIdent.noOuterThisPath
  • 2fce7cb: 8272963: Update the java manpage markdown source
  • ... and 4 more: https://git.openjdk.java.net/jdk/compare/683e30db79789ee44b3cc0b44c085de4615bca7b...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 Aug 30, 2021
@igraves
Copy link
Member Author

igraves commented Sep 3, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Sep 3, 2021

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

  • 7fff22a: 8272805: Avoid looking up standard charsets
  • 92b05fe: 8273251: Call check_possible_safepoint() from SafepointMechanism::process_if_requested()
  • 29e0f13: 8272385: Enforce ECPrivateKey d value to be in the range [1, n-1] for SunEC provider
  • aaa6f69: 8273250: Address javadoc issues in Deflater::setDictionationary
  • 5ee5dd9: 8272914: Create hotspot:tier2 and hotspot:tier3 test groups
  • 5245c1c: 8273147: Update and restructure TestGCLogMessages log message list
  • 632a7e0: 8273165: GraphKit::combine_exception_states fails with "matching stack sizes" assert
  • c2e015c: 8273229: Update OS detection code to recognize Windows Server 2022
  • 0c1b16b: 8273243: Fix indentations in java.net.InetAddress methods
  • 152e669: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/683e30db79789ee44b3cc0b44c085de4615bca7b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 3, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 3, 2021
@openjdk
Copy link

openjdk bot commented Sep 3, 2021

@igraves Pushed as commit dd87181.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants