From c9d2fe53acc543aadc5cf189faaf47754d2cf33d Mon Sep 17 00:00:00 2001 From: chasse20 Date: Mon, 30 Nov 2026 13:33:26 -0500 Subject: [PATCH] Run focused GPU parity checks on hosted Lavapipe Use the shared gate with a pinned backend and adapter, require the exact focused cases, and reject missing or skipped GPU assertions. --- .github/scripts/gpu-parity.sh | 54 ++++++++++++++++++++++++++++++++ .github/workflows/gpu-parity.yml | 24 ++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/scripts/gpu-parity.sh create mode 100644 .github/workflows/gpu-parity.yml diff --git a/.github/scripts/gpu-parity.sh b/.github/scripts/gpu-parity.sh new file mode 100644 index 00000000..d93f48e4 --- /dev/null +++ b/.github/scripts/gpu-parity.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Use Lavapipe on the hosted runner and require the GPU assertions. +shopt -s nullglob +icds=(/usr/share/vulkan/icd.d/lvp_icd*.json) +if (( ${#icds[@]} != 1 )); then + printf 'Expected one Lavapipe ICD manifest, found %s\n' "${#icds[@]}" >&2 + exit 1 +fi +export VK_DRIVER_FILES="${icds[0]}" +unset VK_ICD_FILENAMES +export WGPU_BACKEND=vulkan +export WGPU_ADAPTER_NAME=llvmpipe +export TC_CI_LAVAPIPE=1 +export RUST_MIN_STACK=8388608 + +log=$(mktemp) +trap 'rm -f "$log"' EXIT + +run_tests() { + local package=$1 + shift + cargo test --locked -p "$package" --lib -- --exact --nocapture --test-threads=1 "$@" 2>&1 | tee "$log" + if ! grep -Eq "^test result: ok\. $# passed; 0 failed; 0 ignored;" "$log" || + grep -Eq 'skipping GPU assertions|skipping: no GPU adapter' "$log"; then + printf 'The focused GPU tests did not all run in %s\n' "$package" >&2 + exit 1 + fi +} + +run_tests texturecraft-render headless::tests::ci_uses_lavapipe +if ! grep -Eq 'CI renderer adapter: .*llvmpipe.*backend: Vulkan' "$log"; then + printf 'The adapter check did not report Vulkan on llvmpipe\n' >&2 + exit 1 +fi + +# Use separate processes for groups of shaders. Lavapipe retains its compiled pipelines. +run_tests texturecraft-render \ + gpu_composite::brush::tests::a_live_erase_matches_the_cpu_on_layers_and_masks \ + gpu_composite::brush::tests::a_live_mask_image_stroke_matches_the_cpu +run_tests texturecraft-render \ + gpu_composite::udim::tests::a_live_layer_stroke_on_uv_tiles_matches_the_cpu \ + gpu_composite::udim::tests::a_live_mask_stroke_on_uv_tiles_matches_the_cpu +run_tests texturecraft-render gpu_composite::point::tests::gradient_curve_presets_match_the_cpu +run_tests texturecraft-render gpu_composite::stack::tests::layer_comparisons_in_transformed_nested_folders_match_the_cpu_for_owner_and_instance +run_tests texturecraft-render gpu_composite::fill_projection::tests::nearest_image_fills_match_the_cpu +run_tests texturecraft-render renderer::tests::a_regional_gpu_update_populates_the_whole_texture_when_replacing_an_overview +run_tests texturecraft-render \ + gpu_neighbourhood::box_family::tests::distance_maps_scale_bevel_smooth_and_directional_distance_like_the_cpu \ + gpu_neighbourhood::box_family::tests::wrapping_and_mixed_distance_filters_match_the_cpu +run_tests texturecraft-ui-egui \ + gpu::tests::a_smart_mask_preset_renders_its_mask_view_on_the_gpu \ + gpu::tests::an_earlier_model_dirt_generator_renders_its_mask_view_on_the_gpu diff --git a/.github/workflows/gpu-parity.yml b/.github/workflows/gpu-parity.yml new file mode 100644 index 00000000..6dff3fdb --- /dev/null +++ b/.github/workflows/gpu-parity.yml @@ -0,0 +1,24 @@ +name: GPU parity + +on: + pull_request: + push: + branches: [ci/pr713-gpu-parity] + workflow_dispatch: + +permissions: + contents: read + +jobs: + parity: + uses: storytold/craft-common-actions/.github/workflows/gate.yml@main + with: + os: '["ubuntu-24.04"]' + tools: "" + craft-fonts-ref: aced4137c022f1f587624d48e81ec77e1914a9cc + dev-strip: true + timeout-minutes: 60 + packages: >- + mesa-vulkan-drivers libxkbcommon-dev libwayland-dev libx11-dev + libxrandr-dev libxi-dev libgl1-mesa-dev libgtk-3-dev + command: bash .github/scripts/gpu-parity.sh