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.
This commit is contained in:
chasse20
2026-11-30 13:33:26 -05:00
parent 52297c595e
commit c9d2fe53ac
2 changed files with 78 additions and 0 deletions
+54
View File
@@ -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
+24
View File
@@ -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