Files
metal2vulkan/scripts/qualify-public-cases
T
Anees Iqbal 11d8892858 Validation: an authored case calls through a kernel's visible-function table
visible-table-entry-by-thread-calls-add-mul-null-sub (af884d65cb): twelve
threads of the owned visible_table_dispatch each call entry tid % 4 of a
table of four, linking table_add, table_mul and table_sub from the owned
module visible_table_ops, entry 2 left null. Installed with
corpus-case-check and qualified on Metal on the M3 in the primary reference
environment (m3-max-69730: three runs, 3, 3, 0xfffffffd, 0, 7, 15,
0xfffffffd, 4, 11, 27, 0xfffffffd, 8).

The public qualification (CI's lavapipe step) now also runs it and the
public table-query case 3a8f75e182, which the runtime refused before.
2026-11-22 22:11:30 -08:00

68 lines
2.8 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
)
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