open-standards/wai/.github/workflows/ci.yml
Transaction Science 3b6fd99989 Add WAI — Web AI Media Transport & Execution standard
WAI is a container + capability-dispatch standard for media. It does not
re-implement codecs; it dispatches to SOTA standard libraries (PNG, FLAC,
zstd as the mandatory floor; AVIF, JPEG-XL, Opus, AV1, XZ as the
recommended modern set) and adds an envelope that lets a neural
shared-prior path coexist with the model-free floor.

The capability a file requires is named, not supplied. Two paths open
every conforming file: the neural condition (sink regenerates from a
shared ambient prior) and the zeroth condition (registered SOTA codec
menu). Apache-2.0.

Adds:
- wai/SPEC.md — WAI v1.0 spec (envelope, manifest, capability dispatch,
  registered capabilities including v1.1 multi-rendition extension)
- wai/wai-rs/ — Rust reference implementation: lib + cdylib + staticlib,
  C FFI, 11 capability + envelope round-trip tests passing
- wai/wai-web/ — wasm-bindgen wrapper for browser sinks
- wai/wai-neural/ — Python tooling for neural-condition models
- wai/tools/ — codec export + encode helpers (Python)
- wai/corpus/CORPUS.md — third-party test corpus reacquisition guide

Updates README.md to list four standards instead of three.

Known consumer: CommunicationOS uses WAI for media transport over
MoQT/MLS sessions.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-24 13:36:51 -04:00

149 lines
4.5 KiB
YAML

name: ci
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Build + run all tests (lib + ffi robustness + fuzz smoke) on both
# macOS and Linux. Production deployments will hit both; CI gates
# both.
test:
name: test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install system codec libraries (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config \
libjxl-dev \
libavif-dev \
libdav1d-dev \
libopus-dev \
libflac-dev \
libzstd-dev \
liblzma-dev \
ffmpeg \
zstd \
xz-utils
- name: Install system codec libraries (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install \
pkg-config \
jpeg-xl \
libavif \
dav1d \
opus \
flac \
zstd \
xz \
ffmpeg
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
wai-rs/target
key: ${{ matrix.os }}-cargo-${{ hashFiles('wai-rs/Cargo.lock') }}
- name: cargo build --release (lib + bins)
working-directory: wai-rs
run: cargo build --release --lib --bins
- name: Verify SDK artifacts (cdylib + staticlib)
working-directory: wai-rs
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
test -f target/release/libwai.so
test -f target/release/libwai.a
else
test -f target/release/libwai.dylib
test -f target/release/libwai.a
fi
- name: cargo test (lib + ffi robustness + fuzz smoke)
working-directory: wai-rs
run: cargo test --release
# Quick-mode bench on the always-shippable subset of the corpus.
# NOTE: the full corpus (~22 GB) is not committed and CI uses synthetic
# inputs only. For full-corpus regression gating, run on a self-hosted
# runner that mounts the corpus volume.
bench-quick:
name: bench-quick + regression diff
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Install codec libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libjxl-dev libavif-dev libdav1d-dev \
libopus-dev libflac-dev libzstd-dev liblzma-dev \
ffmpeg zstd xz-utils
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build wai_bench + wai_bench_diff
working-directory: wai-rs
run: cargo build --release --bin wai_bench --bin wai_bench_diff
# Synthetic-only quick bench (CI doesn't have the 22 GB corpus).
# Generates synthetic test inputs into a temporary corpus tree so
# the bench has something to walk. Real-corpus regression checks
# happen on the self-hosted runner job below.
- name: Run quick bench (synthetic inputs)
working-directory: wai-rs
run: |
mkdir -p ../corpus/image/{kodak,synthetic} ../corpus/audio/sqam \
../corpus/text ../corpus/video/derf
# tiny PNG fixture so image_interop has at least one input
python3 -c "
from urllib.request import urlretrieve
urlretrieve('https://r0k.us/graphics/kodak/kodak/kodim01.png',
'../corpus/image/kodak/kodim01.png')
"
target/release/wai_bench --report bench-head.json || true
ls -la bench-head.json
- name: Diff against committed baseline (if present)
working-directory: wai-rs
run: |
if [[ -f ../bench-baseline.json ]]; then
target/release/wai_bench_diff ../bench-baseline.json bench-head.json
else
echo "(no bench-baseline.json checked in — skipping regression diff)"
fi
- name: Upload bench report
uses: actions/upload-artifact@v4
with:
name: bench-report-${{ github.sha }}
path: wai-rs/bench-head.json
retention-days: 30