From 830136dfebacced15be10ef84a7a838ea1005ed4 Mon Sep 17 00:00:00 2001 From: Yuri Olive Date: Tue, 3 Nov 2026 21:28:30 -0300 Subject: [PATCH 1/2] ci: add dynarmic unit tests workflow --- .github/workflows/dynarmic-tests.yml | 126 +++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 .github/workflows/dynarmic-tests.yml diff --git a/.github/workflows/dynarmic-tests.yml b/.github/workflows/dynarmic-tests.yml new file mode 100644 index 0000000000..76a18c1276 --- /dev/null +++ b/.github/workflows/dynarmic-tests.yml @@ -0,0 +1,126 @@ +name: dynarmic-tests + +on: + workflow_dispatch: + pull_request: + paths: &paths + - "src/dynarmic/**" + - "CMakeLists.txt" + - "CMakeModules/**" + - "externals/CMakeLists.txt" + - "cpmfile.json" + - ".github/workflows/dynarmic-tests.yml" + push: + branches: + - nx2 + paths: *paths + schedule: + - cron: "0 4 * * 1" + +permissions: + contents: read + +concurrency: + group: dynarmic-tests-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + dynarmic: + name: dynarmic unit tests + runs-on: ubuntu-24.04 + timeout-minutes: 90 + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 1000M + CPM_SOURCE_CACHE: ${{ github.workspace }}/.cache/cpm + steps: + - name: Check out source + uses: actions/checkout@v5 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + autoconf cmake g++ gcc git glslang-tools libglu1-mesa-dev \ + libpulse-dev libtool libudev-dev mesa-common-dev nasm ninja-build \ + libavfilter-dev libavcodec-dev libswscale-dev pkg-config zlib1g-dev \ + libva-dev libvdpau-dev spirv-tools spirv-headers libusb-1.0-0-dev \ + libboost-dev libboost-fiber-dev libboost-context-dev \ + libopus-dev libasound2-dev ccache catch2 mold + + # Informational only: the x64 backend picks AVX-512 code paths from the host CPU, and + # hosted runners vary, so record what this run actually exercised. Never fails. + - name: Report host CPU features + run: | + uname -m + grep -m1 'model name' /proc/cpuinfo || true + echo "AVX-512 flags:" + grep -o 'avx512[a-z_0-9]*' /proc/cpuinfo | sort -u || echo "(none)" + if grep -q avx512f /proc/cpuinfo; then + echo "AVX-512 PRESENT: AVX-512 code paths are exercised" + else + echo "::notice::host has no AVX-512; AVX-512 emitter paths were NOT exercised in this run" + fi + true + + - name: Restore ccache + uses: actions/cache/restore@v4 + with: + path: .ccache + key: dynarmic-tests-${{ github.sha }} + restore-keys: dynarmic-tests- + + - name: Restore dependency sources + id: cpm + uses: actions/cache/restore@v4 + with: + path: .cache/cpm + # Exact key only: CPMUtil does not recheck a cached source's URL or hash. + key: cpm-${{ hashFiles('cpmfile.json', 'CMakeModules/**', '.patch/**') }} + + # DYNARMIC_TESTS defaults to BUILD_TESTING, which the root build forces OFF, so it must be + # set explicitly. It also gates find_package(Catch2) and oaknut in externals. + - name: Configure + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \ + -DDYNARMIC_TESTS=ON \ + -DENABLE_QT=OFF \ + -DYUZU_CMD=OFF \ + -DYUZU_ROOM=OFF \ + -DYUZU_ROOM_STANDALONE=OFF \ + -DYUZU_USE_BUNDLED_SDL3=ON \ + -DVulkanHeaders_FORCE_BUNDLED=ON \ + -DVulkanUtilityLibraries_FORCE_BUNDLED=ON \ + -DENABLE_UPDATE_CHECKER=OFF \ + -DUSE_DISCORD_PRESENCE=OFF \ + -DENABLE_WERROR=OFF \ + -DUSE_CCACHE=ON + + - name: Build dynarmic_tests + run: | + ccache -z + cmake --build build --target dynarmic_tests --parallel + ccache -s + + - name: Run dynarmic tests + run: | + BIN=$(find build -type f -name dynarmic_tests -perm -u+x | head -n1) + test -n "$BIN" || { echo "::error::dynarmic_tests binary not found"; exit 1; } + echo "Running $BIN" + "$BIN" --durations yes + + - name: Save ccache + if: ${{ always() && github.ref == 'refs/heads/nx2' }} + uses: actions/cache/save@v4 + with: + path: .ccache + key: dynarmic-tests-${{ github.sha }} + + - name: Save dependency sources + if: ${{ always() && github.ref == 'refs/heads/nx2' && steps.cpm.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v4 + with: + path: .cache/cpm + key: cpm-${{ hashFiles('cpmfile.json', 'CMakeModules/**', '.patch/**') }} From 52f27291d5c623578c3dadf18a0dd3961420bcce Mon Sep 17 00:00:00 2001 From: ymatrix1 Date: Wed, 4 Nov 2026 10:59:55 -0300 Subject: [PATCH 2/2] ci: watch build inputs, report AVX-512 availability not execution --- .github/workflows/dynarmic-tests.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dynarmic-tests.yml b/.github/workflows/dynarmic-tests.yml index 76a18c1276..6b79fa7383 100644 --- a/.github/workflows/dynarmic-tests.yml +++ b/.github/workflows/dynarmic-tests.yml @@ -6,7 +6,9 @@ on: paths: &paths - "src/dynarmic/**" - "CMakeLists.txt" + - "src/CMakeLists.txt" - "CMakeModules/**" + - ".patch/**" - "externals/CMakeLists.txt" - "cpmfile.json" - ".github/workflows/dynarmic-tests.yml" @@ -49,17 +51,18 @@ jobs: libopus-dev libasound2-dev ccache catch2 mold # Informational only: the x64 backend picks AVX-512 code paths from the host CPU, and - # hosted runners vary, so record what this run actually exercised. Never fails. + # hosted runners vary. This lists what the host offers; it does not say what the tests ran. + # The A64 CLZ 16-bit path needs avx512vl and avx512cd as well as avx512f. Never fails. - name: Report host CPU features run: | uname -m grep -m1 'model name' /proc/cpuinfo || true echo "AVX-512 flags:" grep -o 'avx512[a-z_0-9]*' /proc/cpuinfo | sort -u || echo "(none)" - if grep -q avx512f /proc/cpuinfo; then - echo "AVX-512 PRESENT: AVX-512 code paths are exercised" + if grep -q avx512f /proc/cpuinfo && grep -q avx512vl /proc/cpuinfo && grep -q avx512cd /proc/cpuinfo; then + echo "::notice::host offers avx512f, avx512vl and avx512cd, the features the AVX-512 CLZ path needs" else - echo "::notice::host has no AVX-512; AVX-512 emitter paths were NOT exercised in this run" + echo "::notice::host lacks avx512f, avx512vl or avx512cd, so the AVX-512 CLZ path is not available to this run" fi true