From 44f9dcb3a2f0beff057c051af20d5deae5e26945 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 20 Jun 2026 11:44:41 +0800 Subject: [PATCH] [Feat] (trace-replay): run retrace fixtures as matrix jobs --- .github/workflows/apk.yml | 354 ++++++++++++++++---- .github/workflows/test.yml | 130 +++++-- android-plugin/run-trace-replay-cases-ci.sh | 105 ------ 3 files changed, 389 insertions(+), 200 deletions(-) delete mode 100644 android-plugin/run-trace-replay-cases-ci.sh diff --git a/.github/workflows/apk.yml b/.github/workflows/apk.yml index 5230ae3d..14106c9e 100644 --- a/.github/workflows/apk.yml +++ b/.github/workflows/apk.yml @@ -93,28 +93,277 @@ jobs: if-no-files-found: error retrace: + name: retrace (${{ matrix.backend.name }}, ${{ matrix.case.name }}) runs-on: ubuntu-latest needs: build - env: - TRACE_REPLAY_CASES: | - OpenRA|tools/trace_replay/fixtures/openra.tgz|openra.trace|tools/trace_replay/fixtures/openra.0000031249.png|31249|640|480|20|1|1|638|478|20|180 - minecraft-1.21.4-startup|tools/trace_replay/fixtures/minecraft-1.21.4-startup.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-startup.0000092195.png|92195|854|480|20|0|0|0|0|20|180 - minecraft-1.21.4-main-menu|tools/trace_replay/fixtures/minecraft-1.21.4-main-menu.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-main-menu.0000481787.png|481787|854|480|500|0|0|0|0|20|180 - minecraft-1.21.4-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-in-world.0000280000.png|280000|854|480|500|0|0|0|0|20|900 - minecraft-1.21.4-fabric-sodium-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-sodium-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-sodium-in-world.0000923340.png|923340|854|480|20|0|0|0|0|20|1800 - minecraft-1.21.4-fabric-iris-bsl-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bsl-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bsl-in-world.0000110725.png|110725|854|480|200|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world.0000095322.png|95322|854|480|20|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world.0000141559.png|141559|854|480|20|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-sundial-lite-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-sundial-lite-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-sundial-lite-in-world.0000150023.png|150023|854|480|20|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world.0000151297.png|151297|854|480|20|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-complementary-unbound-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-unbound-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-unbound-in-world.0000146559.png|146559|854|480|150|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-mellow-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-mellow-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-mellow-in-world.0000096143.png|96143|854|480|20|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-nostalgia-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-nostalgia-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-nostalgia-in-world.0000153808-linux-mesa.png|153808|854|480|60|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-bliss-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bliss-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bliss-in-world.0000113511.png|113511|854|480|40|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world.0000125124-linux-mesa.png|125124|854|480|200|0|0|0|0|20|900 - minecraft-1.21.4-fabric-iris-iterationt-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-in-world.0001173280.png|1173280|854|480|150|0|0|0|0|20|2400 - minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world.0001606997.png|1606997|854|480|150|0|0|0|0|20|2400 - minecraft-1.21.4-fabric-iris-photon-v1.1-in-world|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-photon-v1.1-in-world.tgz|trace.trace|tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-photon-v1.1-in-world.0000159866.png|159866|854|480|20|0|0|0|0|20|900 + strategy: + fail-fast: false + max-parallel: 4 + matrix: + backend: + - name: DirectGLES + id: espryt + apk: MobileGL-EsprytTrace-release.apk + package: top.mobilegl.plugin.espryt.trace + gpu: swiftshader + - name: DirectVulkan + id: magma + apk: MobileGL-MagmaTrace-release.apk + package: top.mobilegl.plugin.magma.trace + gpu: angle + case: + - name: OpenRA + trace_archive: tools/trace_replay/fixtures/openra.tgz + trace_file: openra.trace + golden: tools/trace_replay/fixtures/openra.0000031249.png + target_call: 31249 + width: 640 + height: 480 + tolerance: 20 + crop_x: 1 + crop_y: 1 + crop_width: 638 + crop_height: 478 + fuzz_percent: 20 + timeout_seconds: 180 + - name: minecraft-1.21.4-startup + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-startup.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-startup.0000092195.png + target_call: 92195 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 180 + - name: minecraft-1.21.4-main-menu + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-main-menu.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-main-menu.0000481787.png + target_call: 481787 + width: 854 + height: 480 + tolerance: 500 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 180 + - name: minecraft-1.21.4-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-in-world.0000280000.png + target_call: 280000 + width: 854 + height: 480 + tolerance: 500 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-sodium-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-sodium-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-sodium-in-world.0000923340.png + target_call: 923340 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 1800 + - name: minecraft-1.21.4-fabric-iris-bsl-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bsl-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bsl-in-world.0000110725.png + target_call: 110725 + width: 854 + height: 480 + tolerance: 200 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world.0000095322.png + target_call: 95322 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world.0000141559.png + target_call: 141559 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-sundial-lite-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-sundial-lite-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-sundial-lite-in-world.0000150023.png + target_call: 150023 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world.0000151297.png + target_call: 151297 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-complementary-unbound-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-unbound-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-complementary-unbound-in-world.0000146559.png + target_call: 146559 + width: 854 + height: 480 + tolerance: 150 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-mellow-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-mellow-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-mellow-in-world.0000096143.png + target_call: 96143 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-nostalgia-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-nostalgia-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-nostalgia-in-world.0000153808-linux-mesa.png + target_call: 153808 + width: 854 + height: 480 + tolerance: 60 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-bliss-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bliss-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-bliss-in-world.0000113511.png + target_call: 113511 + width: 854 + height: 480 + tolerance: 40 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world.0000125124-linux-mesa.png + target_call: 125124 + width: 854 + height: 480 + tolerance: 200 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 + - name: minecraft-1.21.4-fabric-iris-iterationt-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-in-world.0001173280.png + target_call: 1173280 + width: 854 + height: 480 + tolerance: 150 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 2400 + - name: minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world.0001606997.png + target_call: 1606997 + width: 854 + height: 480 + tolerance: 150 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 2400 + - name: minecraft-1.21.4-fabric-iris-photon-v1.1-in-world + trace_archive: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-photon-v1.1-in-world.tgz + trace_file: trace.trace + golden: tools/trace_replay/fixtures/minecraft-1.21.4-fabric-iris-photon-v1.1-in-world.0000159866.png + target_call: 159866 + width: 854 + height: 480 + tolerance: 20 + crop_x: 0 + crop_y: 0 + crop_width: 0 + crop_height: 0 + fuzz_percent: 20 + timeout_seconds: 900 steps: - name: Checkout repo @@ -144,60 +393,41 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: Retrace and validate Espryt (DirectGLES) + - name: Retrace and validate run: | - printf '%s\n' "${TRACE_REPLAY_CASES}" > android-retrace-cases.txt - apk_file="$(find android-retrace-apks -name 'MobileGL-EsprytTrace-release.apk' -print -quit)" + apk_file="$(find android-retrace-apks -name '${{ matrix.backend.apk }}' -print -quit)" sh android-plugin/run-avd-ci.sh \ --api-level 35 \ --target google_apis \ --arch x86_64 \ --profile pixel_6 \ - --gpu swiftshader \ - --avd-name mobilegl-espryt \ - -- sh android-plugin/run-trace-replay-cases-ci.sh \ + --gpu "${{ matrix.backend.gpu }}" \ + --avd-name "mobilegl-${{ matrix.backend.id }}" \ + -- sh android-plugin/trace-replay-ci.sh \ --apk-file "${apk_file}" \ - --package top.mobilegl.plugin.espryt.trace \ - --backend DirectGLES \ - --cases-file android-retrace-cases.txt \ + --package "${{ matrix.backend.package }}" \ + --backend "${{ matrix.backend.name }}" \ --result-root android-retrace-result \ - --fixture-root android-retrace-fixture - - - name: Retrace and validate Magma (DirectVulkan) - if: always() - run: | - printf '%s\n' "${TRACE_REPLAY_CASES}" > android-retrace-cases.txt - apk_file="$(find android-retrace-apks -name 'MobileGL-MagmaTrace-release.apk' -print -quit)" - sh android-plugin/run-avd-ci.sh \ - --api-level 35 \ - --target google_apis \ - --arch x86_64 \ - --profile pixel_6 \ - --gpu angle \ - --avd-name mobilegl-magma \ - -- sh android-plugin/run-trace-replay-cases-ci.sh \ - --apk-file "${apk_file}" \ - --package top.mobilegl.plugin.magma.trace \ - --backend DirectVulkan \ - --cases-file android-retrace-cases.txt \ - --result-root android-retrace-result \ - --fixture-root android-retrace-fixture + --fixture-root android-retrace-fixture \ + --case "${{ matrix.case.name }}" \ + --trace-archive "${{ matrix.case.trace_archive }}" \ + --trace-file "${{ matrix.case.trace_file }}" \ + --golden "${{ matrix.case.golden }}" \ + --target-call "${{ matrix.case.target_call }}" \ + --width "${{ matrix.case.width }}" \ + --height "${{ matrix.case.height }}" \ + --tolerance "${{ matrix.case.tolerance }}" \ + --crop-x "${{ matrix.case.crop_x }}" \ + --crop-y "${{ matrix.case.crop_y }}" \ + --crop-width "${{ matrix.case.crop_width }}" \ + --crop-height "${{ matrix.case.crop_height }}" \ + --fuzz-percent "${{ matrix.case.fuzz_percent }}" \ + --timeout-seconds "${{ matrix.case.timeout_seconds }}" - name: Upload Android retrace result if: always() uses: actions/upload-artifact@v4 with: - name: MobileGL-android-retrace-result-${{ env.date_today }}-${{ env.short_sha }} + name: MobileGL-android-retrace-result-${{ env.date_today }}-${{ env.short_sha }}-${{ matrix.backend.name }}-${{ matrix.case.name }} path: android-retrace-result/** if-no-files-found: warn - - - name: Check Android retrace results - if: always() - run: | - direct_gles_status="$(cat android-retrace-result/status/DirectGLES.status 2>/dev/null || echo 1)" - direct_vulkan_status="$(cat android-retrace-result/status/DirectVulkan.status 2>/dev/null || echo 1)" - echo "DirectGLES status: ${direct_gles_status}" - echo "DirectVulkan status: ${direct_vulkan_status}" - if [ "${direct_gles_status}" -ne 0 ] || [ "${direct_vulkan_status}" -ne 0 ]; then - exit 1 - fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 90f0d502..5e794997 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -188,7 +188,7 @@ jobs: working-directory: build-linux/MobileGL/MG_Benchmark run: ctest -V -C Release - retrace: + build-retrace: runs-on: ubuntu-latest needs: build-linux env: @@ -266,46 +266,110 @@ jobs: - name: Build trace replay run: cmake --build "${BUILD_DIR}" --target mobilegl_trace_replay --parallel "$(nproc)" - - name: Retrace and validate Espryt (DirectGLES) - working-directory: build-retrace + - name: Normalize CTest command paths run: | - set +e - ctest -V -R 'MobileGLTraceReplay\..*\.DirectGLES' - status=$? - mkdir -p tools/trace_replay/status - echo "${status}" > tools/trace_replay/status/DirectGLES.status - exit 0 + python - <<'PY' + from pathlib import Path + import re - - name: Retrace and validate Magma (DirectVulkan) - working-directory: build-retrace + for path in Path('build-retrace').rglob('CTestTestfile.cmake'): + text = path.read_text() + text = re.sub(r'"[^"]*/cmake-[^"]*/bin/cmake"', '"cmake"', text) + path.write_text(text) + PY + + - name: Package trace replay run: | - set +e - ctest -V -R 'MobileGLTraceReplay\..*\.DirectVulkan' - status=$? - mkdir -p tools/trace_replay/status - echo "${status}" > tools/trace_replay/status/DirectVulkan.status - exit 0 + mkdir -p ci-artifacts + tar -czf ci-artifacts/mobilegl-trace-replay.tgz \ + build-retrace/tools/trace_replay/mobilegl_trace_replay \ + build-retrace/tools/trace_replay/CTestTestfile.cmake + + - name: Upload trace replay + uses: actions/upload-artifact@v4 + with: + name: mobilegl-trace-replay + path: ci-artifacts/mobilegl-trace-replay.tgz + if-no-files-found: error + + retrace: + name: retrace (${{ matrix.backend }}, ${{ matrix.case }}) + runs-on: ubuntu-latest + needs: + - build-linux + - build-retrace + strategy: + fail-fast: false + max-parallel: 4 + matrix: + backend: + - DirectGLES + - DirectVulkan + case: + - OpenRA + - minecraft-1.21.4-startup + - minecraft-1.21.4-main-menu + - minecraft-1.21.4-in-world + - minecraft-1.21.4-fabric-sodium-in-world + - minecraft-1.21.4-fabric-iris-bsl-in-world + - minecraft-1.21.4-fabric-iris-makeup-ultrafast-in-world + - minecraft-1.21.4-fabric-iris-super-duper-vanilla-in-world + - minecraft-1.21.4-fabric-iris-sundial-lite-in-world + - minecraft-1.21.4-fabric-iris-complementary-reimagined-in-world + - minecraft-1.21.4-fabric-iris-complementary-unbound-in-world + - minecraft-1.21.4-fabric-iris-mellow-in-world + - minecraft-1.21.4-fabric-iris-nostalgia-in-world + - minecraft-1.21.4-fabric-iris-bliss-in-world + - minecraft-1.21.4-fabric-iris-chocapic-v6-lite-in-world + - minecraft-1.21.4-fabric-iris-iterationt-in-world + - minecraft-1.21.4-fabric-iris-iterationt-nodsa-in-world + - minecraft-1.21.4-fabric-iris-photon-v1.1-in-world + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + lfs: true + submodules: recursive + + - name: Get CMake + uses: lukka/get-cmake@latest + + - name: Install runtime dependencies + run: | + sudo apt-get update + sudo apt-get install -y libvulkan1 libegl1 libgles2 libgl1-mesa-dri mesa-vulkan-drivers + + - name: Download Linux runtime + uses: actions/download-artifact@v4 + with: + name: mobilegl-linux-runtime + path: . + + - name: Download trace replay + uses: actions/download-artifact@v4 + with: + name: mobilegl-trace-replay + path: . + + - name: Unpack retrace runtime + run: | + tar -xzf mobilegl-linux-runtime.tgz + tar -xzf mobilegl-trace-replay.tgz + test -f build-linux/libMobileGL.so + test -f build-retrace/tools/trace_replay/mobilegl_trace_replay + + - name: Retrace and validate + working-directory: build-retrace/tools/trace_replay + run: ctest -V --no-tests=error -R '^MobileGLTraceReplay\.${{ matrix.case }}\.${{ matrix.backend }}$' - name: Upload actual image if: always() uses: actions/upload-artifact@v4 with: - name: retrace-result + name: retrace-result-${{ matrix.backend }}-${{ matrix.case }} path: | - build-retrace/tools/trace_replay/*/actual-images/** - build-retrace/tools/trace_replay/*/*/output/** - build-retrace/tools/trace_replay/status/*.status + build-retrace/tools/trace_replay/${{ matrix.case }}/actual-images/** + build-retrace/tools/trace_replay/${{ matrix.case }}/${{ matrix.backend }}/output/** if-no-files-found: warn - - name: Check retrace results - if: always() - working-directory: build-retrace - run: | - direct_gles_status="$(cat tools/trace_replay/status/DirectGLES.status 2>/dev/null || echo 1)" - direct_vulkan_status="$(cat tools/trace_replay/status/DirectVulkan.status 2>/dev/null || echo 1)" - echo "DirectGLES status: ${direct_gles_status}" - echo "DirectVulkan status: ${direct_vulkan_status}" - if [ "${direct_gles_status}" -ne 0 ] || [ "${direct_vulkan_status}" -ne 0 ]; then - exit 1 - fi - diff --git a/android-plugin/run-trace-replay-cases-ci.sh b/android-plugin/run-trace-replay-cases-ci.sh deleted file mode 100644 index 585d8102..00000000 --- a/android-plugin/run-trace-replay-cases-ci.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<'EOF' -Usage: - sh android-plugin/run-trace-replay-cases-ci.sh \ - --apk-file FILE \ - --package PACKAGE \ - --backend BACKEND \ - --cases-file FILE \ - --result-root DIR \ - --fixture-root DIR -EOF -} - -die() { - echo "run-trace-replay-cases-ci.sh: $*" >&2 - usage >&2 - exit 2 -} - -next_arg() { - if [ "$#" -lt 2 ]; then - die "$1 requires a value" - fi - printf '%s' "$2" -} - -require_value() { - value="$1" - name="$2" - if [ -z "${value}" ]; then - die "missing ${name}" - fi -} - -apk_file="" -package_name="" -backend="" -cases_file="" -result_root="" -fixture_root="" - -while [ "$#" -gt 0 ]; do - case "$1" in - --apk-file) apk_file="$(next_arg "$@")"; shift 2 ;; - --package) package_name="$(next_arg "$@")"; shift 2 ;; - --backend) backend="$(next_arg "$@")"; shift 2 ;; - --cases-file) cases_file="$(next_arg "$@")"; shift 2 ;; - --result-root) result_root="$(next_arg "$@")"; shift 2 ;; - --fixture-root) fixture_root="$(next_arg "$@")"; shift 2 ;; - -h|--help) usage; exit 0 ;; - *) die "unknown argument: $1" ;; - esac -done - -require_value "${apk_file}" "--apk-file" -require_value "${package_name}" "--package" -require_value "${backend}" "--backend" -require_value "${cases_file}" "--cases-file" -require_value "${result_root}" "--result-root" -require_value "${fixture_root}" "--fixture-root" - -status=0 -mkdir -p "${result_root}/status" - -if [ ! -f "${apk_file}" ]; then - echo "APK does not exist: ${apk_file}" >&2 - echo 1 > "${result_root}/status/${backend}.status" - exit 0 -fi - -if [ ! -f "${cases_file}" ]; then - echo "cases file does not exist: ${cases_file}" >&2 - echo 1 > "${result_root}/status/${backend}.status" - exit 0 -fi - -while IFS='|' read -r case_name trace_archive trace_file golden target_call width height tolerance crop_x crop_y crop_width crop_height fuzz_percent timeout_seconds; do - [ -n "${case_name}" ] || continue - sh android-plugin/trace-replay-ci.sh \ - --apk-file "${apk_file}" \ - --package "${package_name}" \ - --backend "${backend}" \ - --result-root "${result_root}" \ - --fixture-root "${fixture_root}" \ - --case "${case_name}" \ - --trace-archive "${trace_archive}" \ - --trace-file "${trace_file}" \ - --golden "${golden}" \ - --target-call "${target_call}" \ - --width "${width}" \ - --height "${height}" \ - --tolerance "${tolerance}" \ - --crop-x "${crop_x}" \ - --crop-y "${crop_y}" \ - --crop-width "${crop_width}" \ - --crop-height "${crop_height}" \ - --fuzz-percent "${fuzz_percent}" \ - --timeout-seconds "${timeout_seconds}" \ - || status=1 -done < "${cases_file}" - -echo "${status}" > "${result_root}/status/${backend}.status"