Files
metal2vulkan/.github/workflows/ci.yml
T
Anees Iqbal 8b78eaca3b Expand macOS 26 AIR translation coverage
Overhaul the validation workflow around sharded authored cases, dependency-exact observations, incremental indexed corpus audits, bounded parallel translation, and native Metal/Vulkan comparison.\n\nExpand native AIR lowering, reflection, linked-function specialization, resource and stage-interface support, and structural CFG/pointer repair across the harvested macOS 26 corpus. Add exact intrinsic inventory, distributed 16x16x16 matrix lowering, explicit opaque tensor linkage, and regression coverage for the newly supported feature classes.\n\nThe final corpus verification accounts for all 88,819 indexed AIR modules under the current product fingerprint: 65,355 translate and validate directly, 23,464 require exact authored linkage, and zero fail or remain unresolved.
2026-08-13 21:46:27 +02:00

112 lines
4.1 KiB
YAML

name: CI
on:
push:
branches: [main, master]
pull_request:
env:
CARGO_TERM_COLOR: always
# Fail the job on any rustc warning (unused imports, dead_code, etc.).
RUSTFLAGS: -Dwarnings
jobs:
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Pin major OS images (not *-latest). Labels from actions/runner-images:
# ubuntu-26.04 — Ubuntu 26.04 LTS
# macos-26 — macOS 26 (arm64 GitHub-hosted runner)
os: [ubuntu-26.04, macos-26]
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install LLVM + SPIR-V tools (Ubuntu)
if: runner.os == 'Linux'
run: |
set -euo pipefail
sudo apt-get update
# llvm: llvm-dis; spirv-tools: spirv-val + the product passthrough path's spirv-as.
# Keep lavapipe available for explicit
# corpus-vulkan qualification on GPU-less Linux runners.
sudo apt-get install -y llvm spirv-tools mesa-vulkan-drivers libvulkan1
command -v llvm-dis
command -v spirv-val
command -v spirv-as
# Fail setup early if an explicit corpus-vulkan run would have no ICD.
shopt -s nullglob
icds=(/usr/share/vulkan/icd.d/*.json /etc/vulkan/icd.d/*.json)
echo "Vulkan ICDs: ${icds[*]:-none}"
test "${#icds[@]}" -gt 0
- name: Install LLVM + SPIR-V tools (macOS)
if: runner.os == 'macOS'
run: |
set -euo pipefail
brew install llvm spirv-tools
# llvm is keg-only: not linked into /opt/homebrew/bin. GITHUB_PATH only
# affects *later* steps, so export PATH here before command -v probes.
export PATH="/opt/homebrew/opt/llvm/bin:/usr/local/opt/llvm/bin:${PATH}"
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
echo "/usr/local/opt/llvm/bin" >> "$GITHUB_PATH"
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
command -v llvm-dis
command -v spirv-val
command -v spirv-as
- name: Format
run: cargo fmt --all -- --check
# clippy --all-targets typechecks the workspace; no separate cargo build step.
- name: Clippy (warnings denied)
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Build public documentation (warnings denied)
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --workspace --all-features --no-deps
- name: Test metal2vulkan
run: cargo test -p metal2vulkan -- --test-threads=1
- name: Test validation suite
run: cargo test -p metal2vulkan-validation -- --test-threads=1
# Machine-specific semantic qualification remains explicit. Linux CI has lavapipe, so it can
# execute the owned public cases against their exact committed Metal observations without a
# physical GPU. Rows written here are ephemeral CI evidence, not committed environment slots.
- name: Qualify public cases on native Vulkan (Linux)
if: runner.os == 'Linux'
run: |
set -euo pipefail
cargo build -p metal2vulkan-validation --bins
for case_id in \
d9ce86618e0924966fbb1e7de63761ef471bb6e85b592a70193a26375ec0423f \
4659fedddd1695fba79c3faa797ec3be647e3fd1a87ecec23bde55ccbfbcf656 \
1e54315eb0ffcac633d4992c577f3e6ac384ed1bdf2321887c1f37242c00c887
do
target/debug/corpus-vulkan \
--case-id "$case_id" \
--metal-environment-id apple-m2-macos26.5.2 \
--environment-id ubuntu-26.04-lavapipe
done
target/debug/corpus-index
target/debug/corpus-index --check
status=$(target/debug/corpus-status --limit 20)
echo "$status"
if grep -Eq 'vulkan=(missing|stale|failed)' <<<"$status"; then
echo "native Vulkan qualification is incomplete" >&2
exit 1
fi