Files
metal2vulkan/scripts/qualify-public-cases
T
Anees Iqbal c718924d44 CI: qualify the AIR 1.8 sampling case on lavapipe with the other public cases
scripts/qualify-public-cases runs case 884ad7d75a22 against its committed Metal row. Run by hand
under the same operator environment (ci-lavapipe, job m3-max-73980 on lavapipe 23.1.1): Match,
candidate output 7d65bff73d82, Metal's bytes.
2026-11-25 13:37:09 -08:00

71 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# The "Qualify public cases on native Vulkan (Linux)" step of .github/workflows/ci.yml, shared
# with scripts/linux-gate-ci so the two cannot drift.
#
# scripts/qualify-public-cases <bin-dir> # <bin-dir> holds the built validation binaries
#
# Executes the owned public cases with the engine (the only engine the validation binaries run
# since cutover X2b) on the CPU Vulkan ICD (lavapipe), against their committed
# Metal observations in the reference list's primary environment
# (crates/metal2vulkan-validation/cutover/c3-references.json), then rebuilds the disposable index and
# requires each case's engine slot to be current. Run it from the repository root.
#
# Rows written here are ephemeral CI evidence under the operator environment `ci-lavapipe`, which
# no C3 venue names: a runner's lavapipe is not a venue's declared device, so a
# venue's environment would refuse it (`venue_mismatch`), and these rows are no venue's evidence.
#
# A public checkout has no private store, so `corpus-index` indexes only the rows of public
# sources and reports the committed rows of private AIR it left out (`scope=public-only ...`);
# any failure of it fails the step.
set -euo pipefail
[ "$#" -eq 1 ] || { echo "usage: scripts/qualify-public-cases <bin-dir>" >&2; exit 64; }
bin=$1
export LP_NUM_THREADS=1
environment=ci-lavapipe
metal=$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["primary"]["environment_id"])' \
crates/metal2vulkan-validation/cutover/c3-references.json)
cases=(
d9ce86618e0924966fbb1e7de63761ef471bb6e85b592a70193a26375ec0423f
4659fedddd1695fba79c3faa797ec3be647e3fd1a87ecec23bde55ccbfbcf656
1e54315eb0ffcac633d4992c577f3e6ac384ed1bdf2321887c1f37242c00c887
# A kernel that asks two bound visible-function tables whether they are null and their sizes,
# and one that calls through a table of four entries, one of them null.
3a8f75e182b71ba42a94dd39d178cf6789010fbe1355b56944adf0a1c75ba807
af884d65cb584518fcb8b7319dfe9deff15b20604cfc68f6d72dd97ca3113536
# An AIR 1.8 fragment (engine/air_1_8_sampling) that samples plainly and by gradient through
# an argument sampler: the forms an AIR library declares before AIR 2.0.
884ad7d75a221a11480581ae8d55ef5773defdd021c4fc56c6bde51445e87d37
)
for case_id in "${cases[@]}"; do
"$bin/corpus-vulkan" \
--case-id "$case_id" \
--metal-environment-id "$metal" \
--environment-id "$environment" \
--device-type cpu
done
"$bin/corpus-index"
"$bin/corpus-index" --check
named=()
for case_id in "${cases[@]}"; do
named+=(--case-id "$case_id")
done
status=$("$bin/corpus-status" "${named[@]}")
echo "$status"
incomplete=0
tab=$'\t'
slot="$environment@engine"
for case_id in "${cases[@]}"; do
if ! grep -Fqx "slot${tab}${case_id}${tab}vulkan${tab}${slot}${tab}current" <<<"$status"; then
echo "native Vulkan qualification of $case_id in $slot is not current" >&2
incomplete=1
fi
done
if [ "$incomplete" -ne 0 ]; then
echo "native Vulkan qualification is incomplete" >&2
exit 1
fi