From 043c94d2c6fe2ceeba77dc945b91ba011fbc0b3b Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Fri, 17 Jan 2025 22:16:59 +0000 Subject: [PATCH 1/3] GCC repro --- .github/workflows/build_test.yaml | 435 +----------------------------- 1 file changed, 1 insertion(+), 434 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index d47f5da1..4c06cea9 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -8,67 +8,6 @@ on: - main jobs: - build-ubuntu-arm64-clang: - name: Ubuntu arm64 Clang - runs-on: ubuntu-24.04-arm - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Install ImageMagick - run: sudo apt install imagemagick - - - name: Build release - run: | - export CXX=clang++ - mkdir build_rel - cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_SVE_256=ON -DASTCENC_ISA_NONE=ON -DASTCENC_PACKAGE=arm64 .. - make install package -j4 - - - name: Build debug - run: | - export CXX=clang++ - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_SVE_256=ON -DASTCENC_ISA_NONE=ON .. - make -j4 - - - name: Upload binaries - uses: actions/upload-artifact@v4 - with: - name: astcenc-linux-arm64 - path: | - build_rel/*.zip - build_rel/*.zip.sha256 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Run system tests - # GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here - run: | - python ./Test/astc_test_functional.py --encoder none - python ./Test/astc_test_functional.py --encoder neon - python ./Test/astc_test_functional.py --encoder sve_128 - python ./Test/astc_test_image.py --encoder none --test-set Small - python ./Test/astc_test_image.py --encoder neon --test-set Small - python ./Test/astc_test_image.py --encoder sve_128 --test-set Small - - - name: Run unit tests - # GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here - run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure - working-directory: build_rel - build-ubuntu-arm64-gcc: name: Ubuntu arm64 GCC runs-on: ubuntu-24.04-arm @@ -91,377 +30,5 @@ jobs: export CXX=g++-14 mkdir build_rel cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_NONE=ON .. + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_SVE_256=ON .. make install -j4 - - - name: Build debug - run: | - export CXX=g++-14 - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_NEON=ON DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_NONE=ON .. - make -j4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Run system tests - # GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here - run: | - python ./Test/astc_test_functional.py --encoder none - python ./Test/astc_test_functional.py --encoder neon - python ./Test/astc_test_functional.py --encoder sve_128 - python ./Test/astc_test_image.py --encoder none --test-set Small - python ./Test/astc_test_image.py --encoder neon --test-set Small - python ./Test/astc_test_image.py --encoder sve_128 --test-set Small - - - name: Run unit tests - # GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here - run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure - working-directory: build_rel - - build-ubuntu-x64-clang: - name: Ubuntu x64 Clang - runs-on: ubuntu-22.04 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Build release - run: | - export CXX=clang++ - mkdir build_rel - cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 .. - make install package -j4 - - - name: Build debug - run: | - export CXX=clang++ - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON .. - make -j4 - - - name: Upload binaries - uses: actions/upload-artifact@v4 - with: - name: astcenc-linux-x64 - path: | - build_rel/*.zip - build_rel/*.zip.sha256 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Run system tests - run: | - python ./Test/astc_test_functional.py --encoder none - python ./Test/astc_test_functional.py --encoder sse2 - python ./Test/astc_test_functional.py --encoder sse4.1 - python ./Test/astc_test_functional.py --encoder avx2 - python ./Test/astc_test_image.py --encoder none --test-set Small - python ./Test/astc_test_image.py --encoder all-x86 --test-set Small - - - name: Run unit tests - run: ctest --rerun-failed --output-on-failure - working-directory: build_rel - - build-ubuntu-x64-gcc: - name: Ubuntu x64 GCC - runs-on: ubuntu-22.04 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Build release - run: | - export CXX=g++ - mkdir build_rel - cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 .. - make install package -j4 - - - name: Build debug - run: | - export CXX=g++ - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON .. - make -j4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Python rests - run: | - python ./Test/astc_test_functional.py --encoder none - python ./Test/astc_test_functional.py --encoder sse2 - python ./Test/astc_test_functional.py --encoder sse4.1 - python ./Test/astc_test_functional.py --encoder avx2 - python ./Test/astc_test_image.py --encoder none --test-set Small - python ./Test/astc_test_image.py --encoder all-x86 --test-set Small - - - name: Run unit tests - run: ctest --rerun-failed --output-on-failure - working-directory: build_rel - - build-macos-x64-clang: - name: macOS x64 Clang - runs-on: macos-14 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Build release - run: | - mkdir build_rel - cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_UNIVERSAL_BUILD=OFF -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 .. - make install package -j4 - - - name: Build debug - run: | - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_UNIVERSAL_BUILD=OFF -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON .. - make -j4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Run system tests - run: | - python ./Test/astc_test_image.py --encoder sse4.1 --test-set Small - - - name: Run unit tests - run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure - working-directory: build_rel - - build-macos-universal-clang: - name: macOS universal Clang - runs-on: macos-14 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Build release - run: | - mkdir build_rel - cd build_rel - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_UNIVERSAL_BUILD=ON -DASTCENC_PACKAGE=x64 .. - make install package -j4 - - - name: Build debug - run: | - mkdir build_dbg - cd build_dbg - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_UNIVERSAL_BUILD=ON .. - make -j4 - - - name: Upload binaries - uses: actions/upload-artifact@v4 - with: - name: astcenc-macos-universal - path: | - build_rel/*.zip - build_rel/*.zip.sha256 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - - - name: Run system tests - run: | - python ./Test/astc_test_image.py --encoder universal --test-set Small - - - name: Run unit tests - run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure - working-directory: build_rel - - build-windows-x64-msvc: - name: Windows x64 MSVC - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Setup Visual Studio x86_64 - uses: ilammy/msvc-dev-cmd@v1 - - - name: Build release - run: | - mkdir build_rel - cd build_rel - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 .. - nmake install package - shell: cmd - - - name: Build debug - run: | - mkdir build_dbg - cd build_dbg - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON .. - nmake - shell: cmd - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - shell: cmd - - - name: Run system tests - run: | - python ./Test/astc_test_image.py --test-set Small - shell: cmd - - - name: Run unit tests - run: ctest -C Release --rerun-failed --output-on-failure - working-directory: build_rel - - build-windows-x64-clangcl: - name: Windows x64 ClangCL - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Setup Visual Studio x86_64 - uses: ilammy/msvc-dev-cmd@v1 - - - name: Build release - run: | - mkdir build_rel - cd build_rel - cmake -G "Visual Studio 17 2022" -T ClangCL -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 .. - msbuild astcencoder.sln -property:Configuration=Release - msbuild PACKAGE.vcxproj -property:Configuration=Release - msbuild INSTALL.vcxproj -property:Configuration=Release - shell: cmd - - - name: Build debug - run: | - mkdir build_dbg - cd build_dbg - cmake -G "Visual Studio 17 2022" -T ClangCL -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON .. - msbuild astcencoder.sln -property:Configuration=Debug - shell: cmd - - - name: Upload binaries - uses: actions/upload-artifact@v4 - with: - name: astcenc-windows-x64 - path: | - build_rel/*.zip - build_rel_arm64/*.zip - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get Python modules - run: | - python -m pip install --upgrade pip - pip install numpy Pillow - shell: cmd - - - name: Run system tests - run: | - python ./Test/astc_test_image.py --test-set Small - shell: cmd - - - name: Run unit tests - run: ctest -C Release --rerun-failed --output-on-failure - working-directory: build_rel - - build-windows-arm64-clangcl: - name: Windows arm64 ClangCL - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Setup Visual Studio arm64 - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x86_arm64 - - - name: Build release - run: | - mkdir build_rel - cd build_rel - cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON -DASTCENC_PACKAGE=arm64-clangcl .. - msbuild astcencoder.sln -property:Configuration=Release - msbuild PACKAGE.vcxproj -property:Configuration=Release - msbuild INSTALL.vcxproj -property:Configuration=Release - shell: cmd - - - name: Build debug - run: | - mkdir build_dbg - cd build_dbg - cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON .. - msbuild astcencoder.sln -property:Configuration=Debug - shell: cmd - - - name: Upload binaries - uses: actions/upload-artifact@v4 - with: - name: astcenc-windows-arm64 - path: | - build_rel/*.zip From 78531b594c481b277a05b7d56ea30e031f0041d8 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Fri, 17 Jan 2025 22:18:15 +0000 Subject: [PATCH 2/3] Add bug report --- .github/workflows/build_test.yaml | 3 --- Source/cmake_core.cmake | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 4c06cea9..cf87e24b 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -17,9 +17,6 @@ jobs: with: submodules: 'true' - - name: Install ImageMagick - run: sudo apt install imagemagick - - name: Install GCC 14 run: | sudo apt-get update diff --git a/Source/cmake_core.cmake b/Source/cmake_core.cmake index 59772023..4862616d 100644 --- a/Source/cmake_core.cmake +++ b/Source/cmake_core.cmake @@ -192,6 +192,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_VENEER_TYPE) $<${is_gnu_fe}:-Wno-format-nonliteral> $<${is_gnu_fe}:-Wno-reserved-identifier> $<${is_gnu_fe}:-Wno-cast-function-type> + $<${is_gnu_fe}:-freport-bug> # Force DWARF4 for Valgrind profiling $<$,${is_clang}>:-gdwarf-4> @@ -202,6 +203,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_VENEER_TYPE) target_link_options(${ASTCENC_TARGET_NAME} PRIVATE # Use pthreads on Linux/macOS + $<${is_gnu_fe}:-freport-bug> $<$:-pthread>) if(${ASTCENC_ASAN}) From 8d9cf052403672529e4d88566cff40c171a66f63 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Fri, 17 Jan 2025 22:25:43 +0000 Subject: [PATCH 3/3] Disable LTO --- Source/CMakeLists.txt | 6 ------ Source/UnitTest/cmake_core.cmake | 8 -------- Source/cmake_core.cmake | 5 ----- 3 files changed, 19 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7a430f07..0882ccbe 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -15,12 +15,6 @@ # under the License. # ---------------------------------------------------------------------------- -# Overwrite the LTO flags to force fat LTO; worth 3-4% performance -# See https://gitlab.kitware.com/cmake/cmake/-/issues/16808 -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND ${ASTCENC_CLI}) - set(CMAKE_CXX_COMPILE_OPTIONS_IPO "-flto") -endif() - if(${ASTCENC_DECOMPRESSOR}) set(ASTCENC_CODEC dec) else() diff --git a/Source/UnitTest/cmake_core.cmake b/Source/UnitTest/cmake_core.cmake index 71c99dc2..0631fd98 100644 --- a/Source/UnitTest/cmake_core.cmake +++ b/Source/UnitTest/cmake_core.cmake @@ -19,14 +19,6 @@ set(ASTCENC_TEST test-unit-${ASTCENC_ISA_SIMD}) add_executable(${ASTCENC_TEST}) -# Enable LTO under the conditions where the codec library will use LTO. -# The library link will fail if the settings don't match -if(${ASTCENC_CLI}) - set_property(TARGET ${ASTCENC_TEST} - PROPERTY - INTERPROCEDURAL_OPTIMIZATION_RELEASE True) -endif() - # Use a static runtime on MSVC builds (ignored on non-MSVC compilers) set_property(TARGET ${ASTCENC_TEST} PROPERTY diff --git a/Source/cmake_core.cmake b/Source/cmake_core.cmake index 4862616d..d1d4d880 100644 --- a/Source/cmake_core.cmake +++ b/Source/cmake_core.cmake @@ -264,11 +264,6 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_VENEER_TYPE) endif() if(${ASTCENC_CLI}) - # Enable LTO on release builds - set_property(TARGET ${ASTCENC_TARGET_NAME} - PROPERTY - INTERPROCEDURAL_OPTIMIZATION_RELEASE True) - # Use a static runtime on MSVC builds (ignored on non-MSVC compilers) set_property(TARGET ${ASTCENC_TARGET_NAME} PROPERTY