Update Re: RFR JDK-8223347 Integration of Vector API (Incubator): Java API, implementation, and tests

Ekaterina Pavlova ekaterina.pavlova at oracle.com
Wed May 20 00:06:28 UTC 2020


As I wrote to openjdk alias tier3 seems to be more reasonable tier for incubating feature tests.

Once the tests will be integrated we will also need to add these tests into hs-comp tiers to be tested with
additional compiler flags (like -Xcomp).

-katya


On 5/19/20 3:25 PM, Paul Sandoz wrote:
> I just realized that the vector tests have not been included in any JDK test category e.g. tier1.
> 
> Ordinarily I would expect the tests to be added to tier1 since the tests exercise intrinsics. However, those intrinsics are only enabled with the Vector API module so we could place in another tier to potentially reduce the cost of testing.
> 
> Advice very much appreciate on which tier the tests should belong to.
> 
> Paul.
> 
>> On May 18, 2020, at 12:13 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>>
>> HI,
>>
>> Here’s an update of the API and implementation webrevs based on (mostly) API feedback. We have removed the performance tests to make the review easier (those will be dealt with separately to integration as a follow on task).
>>
>> I think over the past year and recently via the CSR the API has had significant review. Reviews focusing on the Java implementation and tests would be greatly appreciated.
>>
>> It’s worth reiterating that the implementation and tests are quite formulaic, there is a lot of code that is generated from templates, so it's possible to focus on the template + subset (e.g. byte, long, float, and sizes of say 256, max).
>>
>> Notable changes from the prior webrev are:
>>
>> - Removal of the fromValues methods to construct a vector from a varargs array. Feedback indicated this was a misleading way to obtain a vector.
>>
>> - Unification of byte array and ByteBuffer load/store method signatures and unification of the implementations with more tests (including out-of-bounds tests for all the kinds of loads/stores).
>>
>> Paul.
>>
>> --
>>
>> Latest javadoc
>> http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/docs-2020-05-15-88a83f7238d8/api/jdk.incubator.vector/jdk/incubator/vector/package-summary.html <http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/docs-2020-05-15-88a83f7238d8/api/jdk.incubator.vector/jdk/incubator/vector/package-summary.html>
>>
>> Latest specdiff
>> http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/specdiff-jdk-2020-05-15-88a83f7238d8/overview-summary.html <http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/specdiff-jdk-2020-05-15-88a83f7238d8/overview-summary.html>
>>
>> Incremental specdiff
>> http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/specdiff-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/overview-summary.html <http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/specdiff-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/overview-summary.html>
>>
>>
>> Latest implementation webrev
>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev-2020-05-16-default-2020-05-15-88a83f7238d8/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev-2020-05-16-default-2020-05-15-88a83f7238d8/webrev/>
>>
>> Incremental Implementation webrev
>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/webrev/>
>>
>> Latest test webrev
>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev-2020-05-16-default-2020-05-15-88a83f7238d8/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev-2020-05-16-default-2020-05-15-88a83f7238d8/webrev/>
>>
>> Incremental test webrev
>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev-2020-05-11-38dd763d023e-2020-05-15-88a83f7238d8/webrev/>
>>
>>
>>> On Apr 1, 2020, at 3:46 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>>>
>>> Hi,
>>>
>>> A prior email sent out a request for review of the Vector API in preparation for JEP 338: Vector API (Incubator) [1] to be proposed for target:
>>>
>>> https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-March/065345.html <https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-March/065345.html>
>>>
>>> This email expands the review of the API to the Java implementation and Java tests:
>>>
>>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_src_webrev/webrev/>
>>>
>>> http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/JDK-8223347-vector-api-integration-java/jdk_test_webrev/webrev/>
>>>
>>> (Further emails will sent for review of general HotSpot changes CPU architecture specific HotSpot changes, x64 and aarch64, and performance tests.  For an early peek see the links in the description of JDK-8223347.)
>>>
>>>>>>
>>> The Vector API provides
>>>
>>> - the public Vector class with vector operations common to all supported primitive types
>>>
>>> - public primitive specializations, such as IntVector, with common operations associated with the primitive type
>>>
>>> - internal concrete specializations for the vector size, such as Int256Vector, for a vector holding 8 ints.
>>>
>>> Operations generally defer to one of approximately 20 vector intrinsics.  Some operations may be composed of other operations.
>>>
>>> Explicit casts are performed by vector operations to ensure vectors arguments are of the required shape (bit size) and element type.
>>>
>>> A vector intrinsic is an internal low-level vector operation. The last argument to the intrinsic is fall back behavior in Java, implementing the scalar operation over the number of elements held by the vector.  Thus, If the intrinsic is not supported in C2 for the other arguments then the Java implementation is executed (the Java implementation is always executed when running in the interpreter or for C1).
>>>
>>> The public primitive specializations and the internal concrete implementations are generated from SSP template files, X-Vector.java.template and X-VectorBits.java.template respectively.
>>>
>>> Overall the implementation approach is quite formulaic and rather repetitive.  Once you grok the pattern It should be easier to review if a little laborious.
>>>
>>> Unit tests are auto-generated by composing templates for each operation into an SSP template file which is then used to generate unit test files for each concrete vector class.  The tests are quite extensive and have found many a HotSpot issue in development across a wide range of platforms.
>>>
>>> Paul.
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8201271 <https://bugs.openjdk.java.net/browse/JDK-8201271>
>>>
>>
> 



More information about the core-libs-dev mailing list