RFR: 8367657: C2 SuperWord: NormalMapping demo from JVMLS 2025 [v5]
Christian Hagedorn
chagedorn at openjdk.org
Tue Sep 16 08:30:54 UTC 2025
On Tue, 16 Sep 2025 07:57:38 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Demo from here:
>> https://inside.java/2025/08/16/jvmls-hotspot-auto-vectorization/
>>
>> Cleaned up and enhanced with a JTREG and IR test.
>> I also added some additional "generated" normal maps from height functions.
>> And I display the resulting image side-by-side with the normal map.
>>
>> I decided to put it in a new directory `compiler.gallery`, anticipating other compiler tests that are both visually appealing (i.e. can be used for a "gallery") and that we may want to back up with other tests like IR testing.
>>
>> There is a **stand-alone** way to run the demo:
>> `java test/hotspot/jtreg/compiler/gallery/NormalMapping.java`
>> (though it may only run with JDK22+, probably due some amber features)
>>
>> **Quick Perforance Numbers**, running on my avx512 laptop.
>> default / AVX3: 105 FPS
>> AVX2: 82 FPS
>> AVX1: 50 FPS
>> No vectorization: 19 FPS
>> GraalJIT: 13 FPS (`jdk-26-ea+5` - probably issue with vectorization / inlining?)
>>
>> Here some snapshots, but **I really recommend pulling the diff and playing with it, it looks much better in motion**:
>> <img width="2000" height="991" alt="image" src="https://github.com/user-attachments/assets/a693fac8-ecf0-43f2-914b-25f76c2f425d" />
>> <img width="2000" height="997" alt="image" src="https://github.com/user-attachments/assets/c2202e6b-6a90-4f90-a3ca-b73304e25905" />
>> <img width="1997" height="992" alt="image" src="https://github.com/user-attachments/assets/0d6da304-6bb9-4b25-9a7b-72019b02d95e" />
>> <img width="1992" height="994" alt="image" src="https://github.com/user-attachments/assets/9f5f7426-0678-45af-a3eb-ac092c262d4c" />
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>
> more for Christian
Looks good (minus two typos), thanks for the updates!
test/hotspot/jtreg/compiler/gallery/NormalMapping.java line 151:
> 149: /**
> 150: * This class represents the lights that are located on the normal map,
> 151: * move around randomyl, and shine their color of light on the scene.
Suggestion:
* moved around randomly, and shine their color of light on the scene.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27282#pullrequestreview-3228335413
PR Review Comment: https://git.openjdk.org/jdk/pull/27282#discussion_r2351429960
More information about the hotspot-compiler-dev
mailing list