Files
metal2vulkan/scripts/qualify-public-cases
T
Anees Iqbal 2fb00a15ae CI: qualify kernel_handle_word_joins's four cases on lavapipe
The public case step now runs the four authored cases of the owned fixture kernel_handle_word_joins
(a sampler or a texture taken from a branch merged at a join, as integer words in a phi and in a
select, and as pointers in a phi) against their Metal observations.

Verified: syntax only (bash -n); the cases' Metal observations and the step's run come next.
2026-12-03 05:57:30 -08:00

106 lines
5.6 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
# A float (engine/fc_float_gate) and a half (engine/fc_half_gate) function constant that gate
# a kernel's argument and a fragment's sample mask: Metal keeps what they gate where the
# value's bits are not all zero (1.5, -0.0 and a quiet NaN), and drops it at +0.0 and unsupplied.
3a843c7911108e011ac425010de8918ea2ffaabc680efe846d1fa60427bb89da
ad28780327b4d7bfdfbeba9985f9a065b96766455d39f2187a45aa667acbcb9d
c7440f65e3dc4b2a20e5a80e1303bd4733973ef4a9d7e0da4f8b2d852b82ead8
8e22d09b34c6911bf89e9a3819fe8935c877298faf69b235cba74f83cc9f0d1e
4db5409a6e7d85d95d16cf6a0c2c6a386ee0a2ca281834c5ebf7d54481a115e5
0ec889df18ff07ab70791b6116fe2dd30331251d9715e62f6644c561ff411426
03cbdd46a5c0dbe4edcd3aaee7205110805835347288f0f8269131e743362d4d
8235cf2527e58712c73b1baacb72b2cd576cf45786fe3024b3776d88c969b71f
579eb7c4c5c2eb7cd30871124eac021cbb131e7931e514cd6ee03234bcc68983
16bb9c40891adce3e478f143c4d0cf1abd093e6b6c8ba1b5793bcff70f50487a
deeca6b1a5f4a5daa333c7cb757bd330eccc2f50870a4b73afe7b3704328c853
0d652c7e36e231111b77232853ae8237603e2eaf0205a30a08c9e517e2b27dfe
4534a2f6acfe169228698c79410b9f69a2a27193be26d24df48f04bfa212f134
18c8aab797757953abb8725f36053c4607a1829a8b4f1dcb8c5b877d697fdf1b
b9bfa9f2737e76d6052e4f705891209af9e7306206b5999acae1a9c30d7a13aa
# A row of floats written four at a time from a float4 (engine/split_store_tail), the first in
# one block and the rest where the row holds them, at rows of 5, 6 and 7 floats, and the four
# in one block at rows of 7: every residue of 16 for the first word's offset.
1c1ad4164a77a6c10927742ee54ce9b5e6757df96f8eaa3a4e5dcf70eb7c3fe3
440c5d434c2c77b1147d0ccf9cd482c4f48424f80f1e72042c0e025e3dcd030c
5cc3b69ff9552e7dc62f5b2f3e89d0c09666f48f9886406506a55842aaf0ead7
861ff4ddf6f7458effd523d90fdb1d816e4d5d1ba39759ef8755bff0b2243817
# mul24 and mad24, unsigned and signed, as a scalar and at 2, 3 and 4 lanes
# (engine/int24_products), with operands in their 24-bit range and outside it.
5f654fa8f41f1ea09229fc65c9a66261ad4a4ff3fc89c4b3c66851e7daf39194
36ffb2b4990596138bbf7e50788d8878d0d32ddc4ac7717558ec3ec668768832
# A sampler or a texture taken from a branch merged at a join (kernel_handle_word_joins): as
# integer words in a phi and in a select, and as pointers in a phi.
b0fe67d9b927e646cb76549d72ac73b9c446526a7635d07032d6bdff28362ea5
2172332f380f4dd6a7ef3166e1148863511532c4aea0677805fdc20f0a60a3a1
a8649cab0d387804f325ea8fa65e10d7064d06fa076a9d4cfba1a15fe2ca41b1
d7b7b490f2dfc6a3cbf669b4e3c6ad9d30c93623dca57acc28755923ff3f9427
)
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