Files
metal2vulkan/scripts/linux-gate-ci
T
Anees Iqbal 5d725aeec7 Delete metal2vulkan-runtime, with every test and script that read it
The cutover deletes the old runtime: crates/metal2vulkan-runtime and its workspace member go.
Nothing in the workspace depends on it any more: the harness and conformance lost their old arms,
and validation dropped its dependency in its own commit.

Adapted in this commit, so no gate reads the deleted tree:
- CI and scripts/linux-gate-ci: the crate's per-feature clippy group, its `-p` in the Windows
  clippy and the test step, and its private-doc-links row go. Packaging needs no edit: the
  workspace's published crates are now metal2vulkan and metal2vulkan-air.
- The published-crates test lists those two; devtools' carried trees and the five nextest groups
  of the old crate's tests go.
- scripts/api-signatures: the crate leaves CRATES, FLOORS and the header, its self-test trees name
  rt (read by the same rules), and the table is re-blessed (the old crate's 4555 rows go);
  api_signatures.rs pins the three crates left.
- scripts/refusal-surface: the old crate's tree and its sections go (RuntimeGap, AppleOnly,
  Problem and the problem enums it forwards to), with their 87 reach rows, the `--delegations`
  verb and the test that counted the old Problem's delegations; docs/REFUSALS.md is regenerated.
  The basis check now holds rt's refusal enums alone, which it already required.
- scripts/api-cost-coverage goes: it measured only the old crate's surface.
- feature_vocabulary.rs: the old crate's two enable tables go; the Khronos and validation tables
  stay held to the vocabulary.
- The conformance coverage generator's by-hand roots read rt instead of the old crate, and
  docs/CONFORMANCE-COVERAGE.md is regenerated (MTLResourceOptions' row, which only the old crate
  modelled, gives way to rt's MTLCommandBufferError).
- scripts/matrix: the harness times the new runtime alone (`--runtime new`), so the rules that
  judged it against the old one go: the new-over-old budget with its floors (floors.tsv,
  gpu-floors.tsv), ceilings, card variance and status table (status.tsv), the frozen arm, the
  base spread and the timing once more it set off, the re-timed pairs, the five creation rounds
  and the old runtime's parked tests and records. A harness row's time is judged as a cross-GPU
  outlier, with its alone runs as before, and the frame and burst rows by their stored
  instruction counts; the creation rows run once, in their own process. docs/VALIDATION.md's
  matrix section says these rules.

Checked locally (python, no build): signatures.py --check and --selftest, refusal_surface.py
--check, --selftest and --missing-basis, coverage.py --check and --selftest, and scripts/matrix's
49 tests pass. The compile gate (fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Windows
clippy for gnullvm and msvc, workspace Rustdoc, packaging, the touched crates' suites on the host
and on lavapipe) runs on this sha as potluck jobs that the landing note names.
2026-11-20 07:01:01 -08:00

100 lines
4.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# The Linux job of .github/workflows/ci.yml, step for step, for `scripts/linux-gate` to run inside
# its container (the default command). Not meant to run on the host: it expects the container's
# environment (a writable source copy as the working directory, CARGO_TARGET_DIR on the slot
# volume, CARGO_BUILD_JOBS set to the share, lavapipe as the only Vulkan ICD).
#
# Keep it in step with ci.yml: every Linux `run:` there has one `step` here, with the same command
# plus the explicit build share (`-j`, or `--build-jobs` for nextest, whose `-j` is its test-thread
# count), which ci.yml leaves to Cargo's default on a dedicated runner. Tests run with nextest's
# default parallelism, as in ci.yml.
set -euo pipefail
: "${CARGO_BUILD_JOBS:?linux-gate-ci runs inside scripts/linux-gate}"
: "${CARGO_TARGET_DIR:?linux-gate-ci runs inside scripts/linux-gate}"
jobs=$CARGO_BUILD_JOBS
# ci.yml job-level env.
export CARGO_TERM_COLOR=always
export RUSTFLAGS=-Dwarnings
# ci.yml's Ubuntu tool step exports this to every later step (GITHUB_ENV).
export METAL2VULKAN_TEST_REQUIRE_PINNED_LLVM=1
gate_start=$SECONDS
step() {
local name=$1
shift
local start=$SECONDS
echo "::: linux-gate step: ${name}"
"$@"
echo "::: linux-gate step ok: ${name} ($((SECONDS - start)) s)"
}
tools_probe() {
command -v llvm-dis
command -v spirv-val
command -v spirv-as
shopt -s nullglob
local icds=(/usr/share/vulkan/icd.d/*.json /etc/vulkan/icd.d/*.json)
echo "Vulkan ICDs: ${icds[*]:-none}"
test "${#icds[@]}" -gt 0
}
cpu_icd_tests() {
# A separate target dir keeps the ordinary (`-Dwarnings`) build warm: a RUSTFLAGS change would
# otherwise rebuild the whole tree in place on every run.
CARGO_TARGET_DIR="${CARGO_TARGET_DIR}-cpu-icd" \
RUSTFLAGS='-Dwarnings --cfg m2v_cpu_icd' LP_NUM_THREADS=1 \
cargo nextest run -p metal2vulkan-validation -p metal2vulkan-rt --all-features \
--build-jobs "$jobs"
}
feature_clippy() {
local features
for features in "" serde ash cli; do
echo "::group::features=${features:-none}"
cargo clippy -p metal2vulkan --all-targets --no-default-features --features "$features" \
-j "$jobs" -- -D warnings
echo "::endgroup::"
done
for features in "" serde; do
echo "::group::metal2vulkan-air features=${features:-none}"
cargo clippy -p metal2vulkan-air --all-targets --no-default-features --features "$features" \
-j "$jobs" -- -D warnings
echo "::endgroup::"
done
}
gpu_cfg_clippy() {
# As cpu_icd_tests, a sibling target dir keeps the ordinary build warm.
CARGO_TARGET_DIR="${CARGO_TARGET_DIR}-gpucfg" RUSTFLAGS='-Dwarnings --cfg m2v_gpu' \
cargo clippy --workspace --all-targets --all-features -j "$jobs" -- -D warnings
}
qualify_public_cases() {
cargo build -p metal2vulkan-validation --bins -j "$jobs"
LP_NUM_THREADS=1 bash scripts/qualify-public-cases "${CARGO_TARGET_DIR}/debug"
}
step "Install LLVM + SPIR-V tools (probe)" tools_probe
step "Format" cargo fmt --all -- --check
step "Clippy (warnings denied)" \
cargo clippy --workspace --all-targets --all-features -j "$jobs" -- -D warnings
step "Clippy under each feature alone (warnings denied)" feature_clippy
step "Clippy under --cfg m2v_gpu (warnings denied)" gpu_cfg_clippy
step "Build public documentation (warnings denied)" \
env RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --all-features --no-deps -j "$jobs"
step "Build the new API's consumer reference (warnings denied)" scripts/api-docs
step "Package the published crates" \
cargo package --workspace --exclude metal2vulkan-validation --exclude metal2vulkan-devtools \
-j "$jobs"
step "Test metal2vulkan" \
cargo nextest run -p metal2vulkan -p metal2vulkan-air -p metal2vulkan-rt \
-p metal2vulkan-devtools --all-features --build-jobs "$jobs"
step "Test validation suite" \
cargo nextest run -p metal2vulkan-validation --all-features --build-jobs "$jobs"
step "Doc tests" cargo test --workspace --all-features --doc -j "$jobs"
step "Test validation suite and the runtime on the CPU Vulkan ICD (Linux)" cpu_icd_tests
step "Qualify public cases on native Vulkan (Linux)" qualify_public_cases
echo "::: linux-gate: all ci.yml Linux steps passed ($((SECONDS - gate_start)) s)"