open-standards/.github/workflows/wai-quantum-cuda.yml
Transaction Science 7443ce1992
All checks were successful
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 21s
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Successful in 11m8s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 1m1s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 5m34s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m58s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m15s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 59s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 4m16s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m3s
standards workspaces build + test / map-rs (pull_request) Successful in 1m20s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 26s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 7m51s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 21s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 51s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m17s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m54s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 9m59s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 5m51s
standards workspaces build + test / openpay (pull_request) Successful in 12m15s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m56s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 4s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
no-vanity-metrics / No new orphan source files (pull_request) Successful in 5s
spec citations resolve / Code cites no section its SPEC lacks (pull_request) Successful in 4s
lockfiles / every Cargo.lock is current (pull_request) Successful in 34s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m15s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m7s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m40s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m14s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m15s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m35s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m13s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m29s
tests in CI / every test file is run by a job or listed with its reason (pull_request) Successful in 3s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 4m17s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m17s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 14s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 9m32s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 10s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 25s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 50s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 2m2s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m20s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m14s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
wai-quantum CUDA member / member · CUDA absent (linux) (pull_request) Successful in 17s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 2m42s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 1m58s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 17m24s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 4s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m21s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m11s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 4s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m15s
wai-pack / wai-pack · macos (pull_request) Successful in 1m42s
wai-pack / wai-pack · linux (pull_request) Successful in 1m50s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 21s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m25s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 3m57s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m49s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m5s
wai-quantum 0.4.4: the fabric's CUDA member
A second accelerator member beside the WebGPU one: the gate kernel in CUDA
C, compiled at run time by the CUDA runtime compiler for each device's own
architecture, certified bit-exact against the CPU reference's pinned
corpus digests. Feature `quantum_fabric_cuda`, opt-in, native targets
only.

The kernel (src/quantum_fabric/lanes64.cu) is a transcription of
lanes::exact_row and apply_words in 64-bit integers, which every CUDA
device has: each fx(a, b) = (a·b + 2^29) >> 30 is exact in 64 bits, each
row's sum too, the lane keeps the low 32 bits, and a sum outside 32 bits
records the gate's op-log index, the lowest winning. One thread per
amplitude pair, one launch per gate, so no thread reads what another
writes within a launch.

The driver and the runtime compiler are loaded when first used, so a
build with the feature runs on a host with no CUDA and finds no member,
with the reason (Discovery::unavailable).

The member mirrors the WebGPU member's surface: discovery with typed
refusals, the arithmetic probe (shared now as lanes::probe_pairs and
first_mismatch), run_lanes / run_program, simulate_from and
simulate_metered, certify, member and member_metered, a Runner for the
Fabric, with_max_qubits and with_source for tests. Its id binds the
device, UUID, PCI location, driver, compiler and memory:
local/gpu-cuda-<12 hex>, keyed in CI as gpu-cuda-sm<major><minor>.

Device tests (tests/cuda_member.rs), on the RTX 4050 (sm_89): the probe
agrees on 65,536 pairs; the kernel matches run_words on 2,000 random
states and gate words, out-of-range runs included; all four pinned
certificates reproduced; random circuits up to 22 qubits and QFTs equal
to native; typed refusals; all six kernel mutants caught; a receipt, a
placement and a Fabric run; repeated runs identical. On a host with no
CUDA the same tests pass over no member.

CI: wai-quantum-cuda.yml, on the GPU host (requires the four
certificates and every mutant caught) and on a runner with no CUDA
(requires the member to say so).

Every lockfile that includes wai-quantum moves to 0.4.4 by its version
line alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 01:14:01 -04:00

105 lines
4.9 KiB
YAML

name: wai-quantum CUDA member
# The fabric's CUDA member: the gate kernel in CUDA C, compiled at run time for
# each device's own architecture and certified bit-exact against the CPU
# reference's pinned corpus digests.
#
# - cuda-hw (jetson-hub, the RTX 4050): the device tests must find exactly the
# declared device, agree with the CPU on the arithmetic probe and on random
# states (out-of-range runs included), reproduce all four pinned certificates
# (two gatesets, random-v1 and fabric-v1), and catch every kernel mutant.
# - cuda-absent (a container with no GPU and no CUDA libraries): the same build
# finds no member and says why, rather than failing; the device tests run over
# no member with the declaration `none`.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- 'wai/wai-quantum/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-cuda.yml'
pull_request:
paths:
- 'wai/wai-quantum/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-cuda.yml'
jobs:
cuda-hw:
name: member · CUDA (jetson-hub)
runs-on: linux-hw
timeout-minutes: 90
env:
WAI_QUANTUM_CUDA_EXPECT: gpu-cuda-sm89
CARGO_PROFILE_DEV_DEBUG: '0'
CARGO_BUILD_JOBS: '8'
steps:
- name: Fetch the source
shell: bash
run: |
set -euo pipefail
want="${{ github.event.pull_request.head.sha || github.sha }}"
rm -rf src && mkdir src && cd src
git init -q
# Fetch the commit itself, not the ref: a later commit on the ref that this
# workflow's paths do not match would otherwise be fetched instead.
git fetch -q --depth 1 http://100.64.224.0:3400/Transaction-Science/open-standards.git "$want"
git checkout -q FETCH_HEAD
got="$(git rev-parse HEAD)"
[ "$got" = "$want" ] || { echo "::error::fetched $got, not $want"; exit 1; }
- name: The member's unit tests
shell: bash
working-directory: src/wai/wai-quantum
run: |
set -euo pipefail
export PATH="$HOME/.cargo/bin:$PATH"
CARGO_TARGET_DIR="$HOME/hw-target/wai-quantum-cuda" nice -n 10 cargo test --locked --features quantum_fabric_cuda --lib -- quantum_fabric_cuda:: quantum_fabric::cuda:: 2>&1 | tee "$RUNNER_TEMP/unit.log"
grep -qE '^test result: ok\. [1-9][0-9]* passed; 0 failed' "$RUNNER_TEMP/unit.log" || { echo "::error::no unit test ran"; exit 1; }
- name: The member's device tests
shell: bash
working-directory: src/wai/wai-quantum
run: |
set -euo pipefail
export PATH="$HOME/.cargo/bin:$PATH"
report="$RUNNER_TEMP/cuda-report.txt"; : > "$report"
WAI_QUANTUM_CUDA_REPORT="$report" CARGO_TARGET_DIR="$HOME/hw-target/wai-quantum-cuda" nice -n 10 \
cargo test --locked --release --features quantum_fabric_cuda --test cuda_member -- --test-threads=1 2>&1 | tee "$RUNNER_TEMP/device.log"
grep -qE '^test result: ok\. 9 passed; 0 failed' "$RUNNER_TEMP/device.log" || { echo "::error::not every device test ran and passed"; exit 1; }
cat "$report"
key="$WAI_QUANTUM_CUDA_EXPECT"
grep -qx "cuda devices: as declared ($key)" "$report" || { echo "::error::the devices found are not the declared ones"; exit 1; }
n="$(grep -c "^cuda certified: key=$key .* parity=bit-exact " "$report")"
[ "$n" = 4 ] || { echo "::error::$n of 4 certificates were earned"; exit 1; }
grep -qx "cuda mutants: key=$key killed 6 of 6" "$report" || { echo "::error::a kernel mutant survived"; exit 1; }
cuda-absent:
name: member · CUDA absent (linux)
runs-on: linux
timeout-minutes: 60
env:
WAI_QUANTUM_CUDA_EXPECT: none
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.98.0
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.98.0
rustup toolchain install 1.98.0 --profile minimal
rustup default 1.98.0
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: No CUDA here, and the member says so
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
report="$RUNNER_TEMP/cuda-report.txt"; : > "$report"
WAI_QUANTUM_CUDA_REPORT="$report" cargo test --locked --features quantum_fabric_cuda --test cuda_member -- --test-threads=1 2>&1 | tee "$RUNNER_TEMP/device.log"
grep -qE '^test result: ok\. 9 passed; 0 failed' "$RUNNER_TEMP/device.log" || { echo "::error::not every device test ran and passed"; exit 1; }
grep -qx 'cuda devices: as declared (none)' "$report" || { echo "::error::the absent case was not established"; exit 1; }