name: wai media golden suite on RISC-V (emulated) # WAI's golden suite for its integer-exact media paths (wai/byte-exact-conformance: the rANS # coder, the integer syntheses, the JPEG AI symbol decode, integer video and its neural # keyframe, the MLIC++-topology codec, the audio and splat codecs, the binary payloads and the # staged residual layers), built for riscv64gc-unknown-linux-gnu and run on that instruction # set: the same golden bytes wai-byte-equality.yml holds x86_64 and arm64 to, on a third one. # One different byte fails the suite. # # There is no RISC-V runner, so the tests run under a user-mode emulator, as # wai-quantum-vector.yml's rvv members do: Debian's static QEMU, pinned and fetched by the job # and named as cargo's runner, never the host's binfmt handler (which some `linux` runners lack # and others run at another version); the build in the cross-rs image for the target, pinned by # digest. The emulated processor is the emulator's default for the target. Emulation inflates # memory and time, and the `linux` hosts are shared: the container is capped at 6 GiB, the # build runs at -j 6, and the emulated run has an hour (it took nine seconds on framework-128gb, # 2026-11-10, its 112 tests passing). A RISC-V processor would run the same tests with no # emulator. # # It runs on a change to what the suite decodes, the paths of wai-byte-equality.yml, in a pull # request's own diff or in a push to main. # A pull request's newer push supersedes its older run; a push to main takes a group of its own, # its commit, so no later push cancels its run (scripts/check-workflow-concurrency.sh says why). concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} cancel-in-progress: true on: pull_request: paths: - 'wai/byte-exact-conformance/**' # Every source the crate #[path]-includes, as in wai-byte-equality.yml. - 'wai/wai-rs/src/neural/int_synth.rs' - 'wai/wai-rs/src/neural/jpegai_mans.rs' - 'wai/wai-rs/src/int_synth.rs' - 'wai/wai-rs/src/int_entropy.rs' - 'wai/wai-rs/src/jpegai_mans.rs' - 'wai/wai-rs/src/rans.rs' - 'wai/wai-rs/src/int_video.rs' - 'wai/wai-rs/src/int_transform.rs' - 'wai/wai-rs/src/int_hyper_synth.rs' - 'wai/wai-rs/src/int_mlicpp.rs' - 'wai/wai-rs/src/int_audio.rs' - 'wai/wai-rs/src/int_splat.rs' - 'wai/wai-rs/src/int_payload/wire.rs' - 'wai/wai-rs/src/staged/predict.rs' - 'wai/wai-rs/src/staged/wir1.rs' - 'wai/wai-rs/src/staged/wir1_arith.rs' - 'wai/staged-conformance/**' - 'wai/wai-rs/src/int_kernels.rs' - 'wai/wai-rs/src/int_ops.rs' - 'wai/wai-ops/**' - 'wai/wai-rs/tests/vectors/int_video/**' - 'wai/wai-rs/tests/vectors/int_hyper/**' - 'wai/wai-rs/tests/vectors/int_mlicpp/**' - 'wai/wai-rs/tests/vectors/int_audio/**' - 'wai/wai-rs/tests/vectors/int_splat/**' - 'rust-toolchain.toml' - '.github/workflows/wai-media-riscv.yml' push: branches: [main] paths: - 'wai/byte-exact-conformance/**' # Every source the crate #[path]-includes, as in wai-byte-equality.yml. - 'wai/wai-rs/src/neural/int_synth.rs' - 'wai/wai-rs/src/neural/jpegai_mans.rs' - 'wai/wai-rs/src/int_synth.rs' - 'wai/wai-rs/src/int_entropy.rs' - 'wai/wai-rs/src/jpegai_mans.rs' - 'wai/wai-rs/src/rans.rs' - 'wai/wai-rs/src/int_video.rs' - 'wai/wai-rs/src/int_transform.rs' - 'wai/wai-rs/src/int_hyper_synth.rs' - 'wai/wai-rs/src/int_mlicpp.rs' - 'wai/wai-rs/src/int_audio.rs' - 'wai/wai-rs/src/int_splat.rs' - 'wai/wai-rs/src/int_payload/wire.rs' - 'wai/wai-rs/src/staged/predict.rs' - 'wai/wai-rs/src/staged/wir1.rs' - 'wai/wai-rs/src/staged/wir1_arith.rs' - 'wai/staged-conformance/**' - 'wai/wai-rs/src/int_kernels.rs' - 'wai/wai-rs/src/int_ops.rs' - 'wai/wai-ops/**' - 'wai/wai-rs/tests/vectors/int_video/**' - 'wai/wai-rs/tests/vectors/int_hyper/**' - 'wai/wai-rs/tests/vectors/int_mlicpp/**' - 'wai/wai-rs/tests/vectors/int_audio/**' - 'wai/wai-rs/tests/vectors/int_splat/**' - 'rust-toolchain.toml' - '.github/workflows/wai-media-riscv.yml' jobs: # Does this pull request's own diff touch the paths below? This forge matches a # workflow's `paths:` against the push, so a merge of main into a branch fires the # workflow whatever the pull request changes; every job here waits on this answer. # A push to main, a schedule, or anything the script cannot determine answers # `true` (scripts/pr-touches-paths.py). relevant: name: does this change touch it runs-on: gate outputs: run: ${{ steps.gate.outputs.run }} steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - id: gate run: | set -euo pipefail r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-media-riscv.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches wai-media-riscv: $r" echo "run=$r" >> "$GITHUB_OUTPUT" golden: name: golden suite ยท riscv64 (emulated) needs: relevant if: needs.relevant.outputs.run == 'true' runs-on: linux timeout-minutes: 90 container: image: ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu@sha256:67ee97dd4719390d299edfcf39f226360ccfb1539e08b078ec187d4848415794 options: --memory=6g --memory-swap=6g env: # The emulator the test binaries run under: Debian's static QEMU, SHA-256 pinned, fetched # by the job and named as cargo's runner. Not the image's own (6.1), and not the host's # binfmt handler. (Not QEMU_*: qemu-user reads every QEMU_