8278889: AArch64: [vectorapi] VectorMaskLoadStoreTest.testMaskCast() test fail #49
Conversation
…test fail This bug appears intermittently and it's caused by vmaskAll_immI[1] when the vector mask size is smaller than max predicate size of running machine. It generates an all-true predicate without considering those inactive bits. That may result in the wrong result of VectorMask.toLong. The problematic code is as below: ``` ShortVector.SPECIES_64.MaskAll(true).toLong() assembly: ptrue p0.h <= MaskAll(true) mov z16.h, p0/z, openjdk#1 mov z17.h, #0 uzp1 z16.b, z16.b, z17.b fmov x10, d16 orr x10, x10, x10, lsr openjdk#7 orr x10, x10, x10, lsr openjdk#14 orr x10, x10, x10, lsr openjdk#28 and x10, x10, #0xff (gdb) p/x $p0 # on an SVE machine with vector length as 64 in bytes $1 = {0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55} Expected: (gdb) p/x $p0 $1 = {0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} ``` Considering MaskAll is used in VectorMask.fromLong() only for a special case and relies on the mechanism of inline and intrinsification, even it could be optimized out, this patch also adds test cases for MaskAll to reproduce this issue stably. Also fix a small issue on register utilization for sve_reduce_[max|min][D|F]. [1] https://github.com/openjdk/jdk18/blob/master/src/hotspot/cpu/aarch64/aarch64_sve.ad#L416 hotspot/compiler/vectorapi, jdk/incubator/vector passed on SVE enabled system. Change-Id: I9631f26f9232ffe7a28b74f14062d945c32fa1fb
|
@theRealELiu The following label will be automatically applied to this pull request:
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. |
Webrevs
|
Thanks for the fix! Overall looks good to me. Just one enhancement suggestion.
sve_ptrue(dst, size, /* VL128 */ 0b01100); | ||
break; | ||
case 256: | ||
sve_ptrue(dst, size, /* VL256 */ 0b01101); |
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.
Why not use an enum for these magic constants?
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.
I think these magic numbers are only used by sve_ptrue and probably there should be no one need to write these magic numbers again. If these magic numbers are really common used, I agree with yours that enum is better.
I ran tier1 and 3 tests in test/hotspot/jtreg/gc/stress/gcbasher/
failed on macosx-aarch64:
java.lang.IllegalStateException
at gc.stress.gcbasher.ByteCursor.readUtf8(ByteCursor.java:110)
at gc.stress.gcbasher.Decompiler.decodeConstantPool(Decompiler.java:310)
at gc.stress.gcbasher.Decompiler.<init>(Decompiler.java:42)
at gc.stress.gcbasher.TestGCBasher.parseClassFiles(TestGCBasher.java:46)
at gc.stress.gcbasher.TestGCBasher.main(TestGCBasher.java:63)
at gc.stress.gcbasher.TestGCBasherWithG1.main(TestGCBasherWithG1.java:40)
It seems new failure.
Thanks for your testing! Looks like it's the same as https://bugs.openjdk.java.net/browse/JDK-8275263. |
It is actually 8275316 which was closed as duplicate 8275263 . Note, I ran additional testing of the same local repo build but without this 8278889 changes and I don't see |
Thanks for your feedback. The failure is really bizarre. Is it possible that caused by the specific toolchain ? This patch doesn't change any common code except the test cases, all the changes are SVE related, and I think mac couldn't touch SVE related code at this moment. Moreover, the log is the same as 8275316, which means perhaps some other patches will trigger this failure as well before the root cause has been fixed. In this way, expose this failure and post a new JBS to involve some mac experts maybe not bad. Otherwise, some patches which looks okay but would be blocked unfortunately. |
This is indeed bizarre. I submitted new build in our infra only for macosx-aarch64-debug and test passed with it (20 times). And it immediately failed with old build. My only suspicion is we may have some uninitialized value[s] in VM somewhere and depending on JVM's code and data layout we can get these strange failures. I am repeating whole tier1 build and testing on all platforms. |
I filed https://bugs.openjdk.java.net/browse/JDK-8279177 |
@theRealELiu This change now passes all automated pre-integration checks. 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 16 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@nsjian, @vnkozlov) but any other Committer may sponsor as well.
|
/integrate |
@theRealELiu |
Is there anyone can help to sponsor this if no more reviews? |
/sponsor |
Going to push as commit 6588bed.
Your commit was automatically rebased without conflicts. |
@vnkozlov @theRealELiu Pushed as commit 6588bed. |
Thanks for all reviewers:P |
This bug appears intermittently and it's caused by vmaskAll_immI[1]
when the vector mask size is smaller than max predicate size of running
machine. It generates an all-true predicate without considering those
inactive bits. That may result in the wrong result of VectorMask.toLong.
The problematic code is as below:
Considering MaskAll is used in VectorMask.fromLong() only for a special
case and relies on the mechanism of inline and intrinsification, even it
could be optimized out, this patch also adds test cases for MaskAll to
reproduce this issue stably.
Also fix a small issue on register utilization for
sve_reduce_[max|min][D|F].
[1] https://github.com/openjdk/jdk18/blob/master/src/hotspot/cpu/aarch64/aarch64_sve.ad#L416
hotspot/compiler/vectorapi, jdk/incubator/vector passed on SVE enabled
system.
Change-Id: I9631f26f9232ffe7a28b74f14062d945c32fa1fb
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/49/head:pull/49
$ git checkout pull/49
Update a local copy of the PR:
$ git checkout pull/49
$ git pull https://git.openjdk.java.net/jdk18 pull/49/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 49
View PR using the GUI difftool:
$ git pr show -t 49
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/49.diff