ci: add tests and artifacts for windows-11-arm

integrate armv8 and armv8-dotprod builds on windows-11-arm in ci, creating the corresponding artifacts.
Correct Makefile to drop warnings when providing a CXX, add MINGW ARM64 to get_native_properties.sh

fixes https://github.com/official-stockfish/Stockfish/issues/5640
closes https://github.com/official-stockfish/Stockfish/pull/6078

No functional change
This commit is contained in:
ppigazzini
2025-05-19 16:44:59 +02:00
committed by Joost VandeVondele
parent 54fb42ddf8
commit e03898b57c
5 changed files with 172 additions and 20 deletions

138
.github/ci/matrix.json vendored
View File

@@ -40,6 +40,18 @@
"ext": ".exe",
"sde": "/d/a/Stockfish/Stockfish/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-win/sde.exe -future --",
"archive_ext": "zip"
},
{
"name": "Windows 11 Mingw-w64 Clang arm64",
"os": "windows-11-arm",
"simple_name": "windows",
"compiler": "clang++",
"comp": "clang",
"msys_sys": "clangarm64",
"msys_env": "clang-aarch64-clang",
"shell": "msys2 {0}",
"ext": ".exe",
"archive_ext": "zip"
}
],
"binaries": [
@@ -51,7 +63,9 @@
"x86-64-avx512",
"x86-64-vnni256",
"x86-64-vnni512",
"apple-silicon"
"apple-silicon",
"armv8",
"armv8-dotprod"
],
"exclude": [
{
@@ -126,12 +140,78 @@
"os": "macos-13"
}
},
{
"binaries": "x86-64",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-sse41-popcnt",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-avx2",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-bmi2",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-avxvnni",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-avx512",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-vnni256",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "x86-64-vnni512",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "apple-silicon",
"config": {
"os": "windows-2022"
}
},
{
"binaries": "apple-silicon",
"config": {
"os": "windows-11-arm"
}
},
{
"binaries": "apple-silicon",
"config": {
"os": "ubuntu-20.04"
}
},
{
"binaries": "apple-silicon",
"config": {
"os": "ubuntu-22.04"
}
},
{
"binaries": "apple-silicon",
"config": {
@@ -139,10 +219,64 @@
}
},
{
"binaries": "apple-silicon",
"binaries": "armv8",
"config": {
"os": "windows-2022"
}
},
{
"binaries": "armv8",
"config": {
"os": "ubuntu-20.04"
}
},
{
"binaries": "armv8",
"config": {
"os": "ubuntu-22.04"
}
},
{
"binaries": "armv8",
"config": {
"os": "macos-13"
}
},
{
"binaries": "armv8",
"config": {
"os": "macos-14"
}
},
{
"binaries": "armv8-dotprod",
"config": {
"os": "windows-2022"
}
},
{
"binaries": "armv8-dotprod",
"config": {
"os": "ubuntu-20.04"
}
},
{
"binaries": "armv8-dotprod",
"config": {
"os": "ubuntu-22.04"
}
},
{
"binaries": "armv8-dotprod",
"config": {
"os": "macos-13"
}
},
{
"binaries": "armv8-dotprod",
"config": {
"os": "macos-14"
}
}
]
}

View File

@@ -63,13 +63,13 @@ jobs:
- name: Check compiler
run: $COMPCXX -v
- name: Show g++ cpu info
if: runner.os != 'macOS'
run: g++ -Q -march=native --help=target
- name: Show clang++ cpu info
if: runner.os == 'macOS'
run: clang++ -E - -march=native -###
- name: Show compiler cpu info
run: |
if [[ "$COMPCXX" == clang* ]]; then
$COMPCXX -E - -march=native -###
else
$COMPCXX -Q -march=native --help=target
fi
# x86-64 with newer extensions tests

View File

@@ -98,6 +98,14 @@ jobs:
msys_sys: clang64
msys_env: clang-x86_64-clang
shell: msys2 {0}
- name: Windows 11 Mingw-w64 Clang arm64
os: windows-11-arm
compiler: clang++
comp: clang
run_armv8_tests: true
msys_sys: clangarm64
msys_env: clang-aarch64-clang
shell: msys2 {0}
defaults:
run:
working-directory: src
@@ -302,8 +310,10 @@ jobs:
- name: Test armv8 build
if: matrix.config.run_armv8_tests
run: |
export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
export LDFLAGS="-static -Wno-unused-command-line-argument"
if [ $COMP == ndk ]; then
export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
export LDFLAGS="-static -Wno-unused-command-line-argument"
fi
make clean
make -j4 ARCH=armv8 build
../tests/signature.sh $benchref
@@ -311,8 +321,10 @@ jobs:
- name: Test armv8-dotprod build
if: matrix.config.run_armv8_tests
run: |
export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
export LDFLAGS="-static -Wno-unused-command-line-argument"
if [ $COMP == ndk ]; then
export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
export LDFLAGS="-static -Wno-unused-command-line-argument"
fi
make clean
make -j4 ARCH=armv8-dotprod build
../tests/signature.sh $benchref

View File

@@ -130,7 +130,13 @@ case $uname_s in
esac
file_ext='tar'
;;
'CYGWIN'*|'MINGW'*|'MSYS'*) # Windows system with POSIX compatibility layer
'MINGW'*'ARM64'*) # Windows ARM64 system with POSIX compatibility layer
# TODO: older chips might be armv8, but we have no good way to detect, /proc/cpuinfo shows x86 info
file_os='windows'
true_arch='armv8-dotprod'
file_ext='zip'
;;
'CYGWIN'*|'MINGW'*|'MSYS'*) # Windows x86_64system with POSIX compatibility layer
get_flags
check_znver_1_2
set_arch_x86_64

View File

@@ -567,11 +567,16 @@ ifeq ($(COMP),ndk)
LDFLAGS += -static-libstdc++ -pie -lm -latomic
endif
### Allow overwriting CXX from command line
ifdef COMPCXX
CXX=$(COMPCXX)
endif
# llvm-profdata must be version compatible with the specified CXX (be it clang, or the gcc alias)
# make -j profile-build CXX=clang++-20 COMP=clang
# Locate the version in the same directory as the compiler used,
# with fallback to a generic one if it can't be located
LLVM_PROFDATA := $(dir $(realpath $(shell which $(CXX))))llvm-profdata
LLVM_PROFDATA := $(dir $(realpath $(shell which $(CXX) 2> /dev/null)))llvm-profdata
ifeq ($(wildcard $(LLVM_PROFDATA)),)
LLVM_PROFDATA := llvm-profdata
endif
@@ -590,11 +595,6 @@ else
endif
endif
### Allow overwriting CXX from command line
ifdef COMPCXX
CXX=$(COMPCXX)
endif
### Sometimes gcc is really clang
ifeq ($(COMP),gcc)
gccversion := $(shell $(CXX) --version 2>/dev/null)