open-standards/.github/workflows/wai-quantum-qudit.yml
Transaction Science 74f1a30c75
Some checks failed
joule-moq-room room service / joule-moq-room · does this change touch it (push) Successful in 17s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Successful in 20s
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Successful in 18s
wai-app and Create / wai-app · does this change touch it (push) Successful in 36s
WAI operation catalogue / does this change touch it (push) Successful in 26s
wai-audit collector and player integration / does this change touch it (push) Successful in 15s
wai-key-proxy / does this change touch it (push) Successful in 17s
wai-ledger service / does this change touch it (push) Successful in 17s
wai-quantum resource estimation / does this change touch it (push) Successful in 19s
wai-fleet service / does this change touch it (push) Successful in 57s
wai-quantum docs, course and locales / does this change touch it (push) Successful in 44s
wai-quantum editors / does this change touch it (push) Successful in 38s
wai-quantum command line / does this change touch it (push) Successful in 52s
wai-quantum pulse and dynamics / does this change touch it (push) Successful in 18s
wai-quantum-landscape-fpga reference design / does this change touch it (push) Successful in 25s
wai-quantum for JavaScript / does this change touch it (push) Successful in 40s
wai-quantum contract / does this change touch it (push) Successful in 47s
wai-quantum for Python / does this change touch it (push) Successful in 17s
wai-quantum other formats / does this change touch it (push) Successful in 48s
wai-quantum OpenQASM reader / does this change touch it (push) Successful in 34s
wai-quantum error correction and mitigation / does this change touch it (push) Successful in 16s
wai-quantum variational and algorithm library / does this change touch it (push) Successful in 14s
wai-quantum extension points / does this change touch it (push) Successful in 36s
wai-quantum service / does this change touch it (push) Successful in 34s
wai-quantum qudit jobs / does this change touch it (push) Successful in 39s
wai-quantum studio and desktop / does this change touch it (push) Successful in 20s
wai-sink-android native sink library / does this change touch it (push) Successful in 17s
wai-quantum views in agent hosts / does this change touch it (push) Successful in 37s
wai-quantum verdicts and repairs / does this change touch it (push) Successful in 41s
WAI Studio / does this change touch it (push) Successful in 46s
wai-sink-swift native sink package / does this change touch it (push) Successful in 47s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Successful in 2m13s
wai-quantum-landscape-fpga reference design / the board's code on the board's processor's architecture · linux-arm64, release (push) Successful in 2m11s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (push) Successful in 2m46s
wai-quantum service / service energy · linux packages (push) Successful in 2m14s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (push) Successful in 4m7s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (push) Successful in 3m53s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 6m53s
joule-moq-room room service / joule-moq-room, every target (push) Successful in 7m40s
wai-quantum extension points / the registry and the example · linux-arm64 (push) Successful in 6m25s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 26s
wai-quantum energy-landscape jobs / does this change touch it (push) Successful in 13s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Successful in 1m15s
wai-key-proxy / proxy · linux (push) Successful in 1m22s
wai-fleet service / service · linux (push) Successful in 2m21s
wai-audit collector and player integration / collector · linux (push) Successful in 4m10s
wai-quantum docs, course and locales / the Studio's words in every locale · linux (push) Successful in 15s
wai-ledger service / service · linux (push) Successful in 4m21s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs under wasm32-wasip2 (wasmtime) (push) Successful in 2m13s
wai-quantum editors / editors · linux (push) Successful in 3m25s
wai-quantum contract / the policy is linked, and the deprecations page reads (push) Successful in 8s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs · linux, release (push) Successful in 3m54s
wai-quantum wasmQ / does this change touch it (push) Successful in 13s
wai-quantum resource estimation / estimation and calibration · linux, release (push) Successful in 6m46s
wai-quantum OpenQASM reader / corpus under wasm32-wasip2 (wasmtime) (push) Successful in 50s
wai-quantum docs, course and locales / the course and the command line's languages · linux (push) Successful in 6m28s
wai-quantum other formats / the set under wasm32-wasip2 (wasmtime) (push) Successful in 1m58s
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (push) Successful in 12m17s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux, release (push) Successful in 2m5s
wai-quantum contract / API compatibility · linux (push) Successful in 5m46s
wai-quantum extension points / the registry under wasm32-wasip2 (wasmtime) (push) Successful in 1m8s
wai-quantum OpenQASM reader / reader and corpus · linux (push) Successful in 4m59s
wai-quantum for JavaScript / javascript · linux (push) Successful in 6m59s
wai-quantum for Python / python · linux (push) Successful in 4m47s
wai-quantum error correction and mitigation / codes, decoders, texts and mitigation · linux, release (push) Successful in 5m43s
wai-quantum qudit jobs / the module and the conformance set under wasm32-wasip2 (wasmtime) (push) Successful in 1m55s
wai-quantum other formats / readers, writers and the set · linux (push) Successful in 7m49s
WAI operation catalogue / the catalogue and every door · linux (push) Successful in 15m51s
wai-quantum qudit jobs / the module, the job, the conformance set, the referee and the verb · linux (push) Failing after 4m5s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 56s
wai-quantum verdicts and repairs / the intent set and the verdict under wasm32-wasip2 (wasmtime) (push) Successful in 2m21s
wai-quantum extension points / the registry and the example · linux (push) Successful in 7m50s
wai-quantum verdicts and repairs / verdicts, repairs and the intent set · linux (push) Successful in 5m14s
wai-quantum service / service · linux (push) Successful in 8m29s
wai-quantum studio and desktop / desktop app · linux (push) Successful in 7m3s
wai-quantum contract / schemas and the committed tool lists · linux (push) Successful in 14m30s
wai-quantum studio and desktop / studio · browser (push) Successful in 8m13s
wai-quantum views in agent hosts / views · the page and its engine (push) Successful in 8m15s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Successful in 54s
wai-quantum views in agent hosts / views · a scripted host (push) Successful in 9m43s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (push) Successful in 22m57s
wai-quantum studio and desktop / desktop app · windows (push) Successful in 9m46s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (push) Successful in 2m19s
wai-fleet service / service · macos (push) Successful in 37s
wai-ledger service / service · macos (push) Successful in 1m19s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Successful in 6m4s
wai-quantum editors / editors · macos (push) Successful in 2m11s
wai-quantum command line / command line · macos (push) Successful in 2m23s
wai-quantum pulse and dynamics / the same bits · macos (push) Successful in 1m48s
wai-quantum command line / command line · linux (push) Successful in 29m0s
WAI Studio / Studio in WebKit · linux (push) Successful in 15m46s
wai-quantum for Python / python · macos (push) Successful in 2m29s
wai-quantum qudit jobs / the same bits · macos (push) Successful in 2m31s
wai-quantum studio and desktop / desktop app · macos (push) Successful in 5m33s
wai-quantum service / service · macos (push) Successful in 6m11s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (push) Successful in 5m20s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Successful in 16m59s
wai-quantum-landscape-fpga reference design / the member against the model of the logic, and the logic against the model · linux, release (push) Successful in 42m39s
WAI Studio / Studio in Chromium and Firefox · macos (push) Successful in 11m13s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (push) Successful in 17m1s
wai-quantum wasmQ / the reference modules rebuild to their modules of record · linux (push) Successful in 39s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 3m55s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 5m33s
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · linux (push) Successful in 4m47s
wai-quantum wasmQ / interpreter and vectors under wasm32-wasip2 (wasmtime) (push) Successful in 5m41s
wai-quantum energy-landscape jobs / native against WebAssembly, over many seeds (push) Successful in 8m57s
wai-quantum energy-landscape jobs / reader, kernels, answers and the stated result · linux, release (push) Successful in 11m22s
wai-quantum energy-landscape jobs / the module under wasm32-wasip2 (wasmtime) (push) Successful in 22m26s
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · macos (push) Successful in 4m7s
wai-quantum energy-landscape jobs / the same bits · macos (push) Successful in 7m27s
wai-quantum: qudits of 4 and 6 levels, every constant exact or the nearest value, and qudit jobs in the engine
quantum_qudit takes d = 4 (roots ±1, ±i, exact) and d = 6 (coordinates ±1/2,
±√3/2, as d = 3's) beside 2 and 3: the dimensions whose roots of unity have
degree at most two. Every other dimension is refused. Each irrational constant
(√3/2 and the Fourier entries 1/√2, 1/√3, 1/(2√3), 1/√6, 1/(2√6), √2/4) is
the nearest multiple of 2^-30, found in whole numbers and proved nearest by a
test; the module had called a floor square root "exact", and 1/√3 was a floor
of a floor, 1.13 units low. The Fourier gate's entries are ω^m/√d applied with
circuit2's arithmetic, so d = 2 is circuit2's H on any state and F_4 is the
two-qubit QFT on every basis state; F_6 is F_2 ⊗ F_3 under the CRT relabelling.
Each gate's rounding and constants are counted (gate_bound), carried to a
2-norm bound on the state (program_bound) and a total-variation bound on the
outcomes (outcomes_bound); the worst measured is 0.79 of the bound.

engine::qudit is the job: a program of shift, clock, fourier, csum and phase
gates, measured with a seed, sealed in the receipt every job takes
(wai.quantum.qudit/1; refusals J090, J091, J092; at most 2^24 amplitudes and
2^32 work, measured at 9.6 s natively and 49.9 s on wasm32). The command line
runs it (wai-quantum qudit run, check, example). extensions/quantum-sim.md §9
states all of it; quantum-conformance/qudit/ holds the constants, 29 vectors
and 35 refusals, the same bytes on arm64 macOS, x86_64 Linux and wasm32-wasip2
(wai-quantum-qudit.yml), with a second implementation in Python.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 15:14:59 -05:00

284 lines
16 KiB
YAML

name: wai-quantum qudit jobs
# Registers of qudits of 2, 3, 4 and 6 levels and the job that runs them
# (wai/extensions/quantum-sim.md section 9; wai_quantum::quantum_qudit, the library, and
# wai_quantum::engine::qudit, the job; `wai-quantum qudit`):
# - native (x86_64 Linux): the module's tests and the job's, each required by name;
# the conformance set (wai/quantum-conformance/qudit/vectors.json), which this host
# must write byte for byte; the second implementation in Python, from the text alone;
# the command line's verb; each feature set that holds the module, built without
# warnings; and no clippy warning in the qudit files;
# - bits (arm64 macOS): the pinned bits and the conformance set, in a debug build and a
# release build;
# - wasip2: the module's tests and the conformance set under wasm32-wasip2 (wasmtime),
# a debug build, so integer overflow panics instead of wrapping.
# A register's amplitudes are integers, so the three hosts give the same bytes or fail.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- 'wai/wai-quantum/src/quantum_qudit.rs'
- 'wai/wai-quantum/src/quantum_qudit/**'
- 'wai/wai-quantum/src/engine/qudit.rs'
- 'wai/wai-quantum/src/engine/qudit/**'
- 'wai/wai-quantum/src/quantum.rs'
- 'wai/wai-quantum/src/engine/receipt.rs'
- 'wai/wai-quantum/src/engine/schema.rs'
- 'wai/wai-quantum/src/engine/refusal.rs'
- 'wai/wai-quantum/src/engine/run.rs'
- 'wai/wai-quantum/schemas/qudit.v1.json'
- 'wai/wai-quantum/tests/qudit_conformance.rs'
- 'wai/wai-quantum/Cargo.toml'
- 'wai/wai-quantum/Cargo.lock'
- 'wai/quantum-conformance/qudit/**'
- 'wai/quantum-conformance/tools/qudit_referee.py'
- 'wai/quantum-conformance/tools/referee.py'
- 'wai/extensions/quantum-sim.md'
- 'wai/wai-quantum-cli/src/qudit.rs'
- 'wai/wai-quantum-cli/src/main.rs'
- 'wai/wai-quantum-cli/Cargo.toml'
- 'wai/wai-quantum-cli/Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-qudit.yml'
pull_request:
paths:
- 'wai/wai-quantum/src/quantum_qudit.rs'
- 'wai/wai-quantum/src/quantum_qudit/**'
- 'wai/wai-quantum/src/engine/qudit.rs'
- 'wai/wai-quantum/src/engine/qudit/**'
- 'wai/wai-quantum/src/quantum.rs'
- 'wai/wai-quantum/src/engine/receipt.rs'
- 'wai/wai-quantum/src/engine/schema.rs'
- 'wai/wai-quantum/src/engine/refusal.rs'
- 'wai/wai-quantum/src/engine/run.rs'
- 'wai/wai-quantum/schemas/qudit.v1.json'
- 'wai/wai-quantum/tests/qudit_conformance.rs'
- 'wai/wai-quantum/Cargo.toml'
- 'wai/wai-quantum/Cargo.lock'
- 'wai/quantum-conformance/qudit/**'
- 'wai/quantum-conformance/tools/qudit_referee.py'
- 'wai/quantum-conformance/tools/referee.py'
- 'wai/extensions/quantum-sim.md'
- 'wai/wai-quantum-cli/src/qudit.rs'
- 'wai/wai-quantum-cli/src/main.rs'
- 'wai/wai-quantum-cli/Cargo.toml'
- 'wai/wai-quantum-cli/Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-qudit.yml'
jobs:
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-quantum-qudit.yml \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")
echo "this change touches qudit jobs: $r"
echo "run=$r" >> "$GITHUB_OUTPUT"
native:
name: the module, the job, the conformance set, the referee and the verb · linux
needs: relevant
if: needs.relevant.outputs.run == 'true'
runs-on: linux
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.99.1
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.99.1
rustup toolchain install 1.99.1 --profile minimal --component clippy
rustup default 1.99.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# A module filter is satisfied by any one test of the module, so the count is
# pinned and each test is required by name to have run and passed.
- name: The module's tests and the job's
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
cargo test --locked --release --no-default-features --features quantum_engine,quantum_receipt --lib -- quantum_qudit:: engine::qudit:: 2>&1 | tee "$RUNNER_TEMP/qudit.log"
grep -qE '^test result: ok\. 26 passed; 0 failed; 1 ignored' "$RUNNER_TEMP/qudit.log" || { echo "::error::the qudit tests did not all pass (26 expected, the measurement ignored)"; exit 1; }
for t in quantum_qudit::tests::every_constant_is_the_nearest_value_and_none_is_a_tie \
quantum_qudit::tests::the_qutrit_constants_are_no_longer_floors \
quantum_qudit::tests::only_the_four_dimensions_are_admitted \
quantum_qudit::tests::the_roots_are_one_table \
quantum_qudit::tests::the_roots_sum_to_zero_and_their_power_is_one \
quantum_qudit::tests::the_fourier_entries_are_the_roots_over_root_d \
quantum_qudit::tests::six_levels_are_a_qubit_times_a_qutrit \
quantum_qudit::tests::at_d_equals_two_it_is_the_qubit_simulator \
quantum_qudit::tests::four_levels_are_the_two_qubit_fourier_transform \
quantum_qudit::tests::shift_and_csum_are_permutations_and_undo_exactly \
quantum_qudit::tests::shift_and_clock_have_order_d \
quantum_qudit::tests::clock_and_shift_obey_the_weyl_relation \
quantum_qudit::tests::fourier_has_order_four_and_its_square_is_the_reflection \
quantum_qudit::tests::every_gate_is_within_its_bound \
quantum_qudit::tests::gate_bounds_are_as_stated \
quantum_qudit::tests::fourier_makes_a_flat_superposition \
quantum_qudit::tests::a_bell_state_has_d_correlated_outcomes \
quantum_qudit::tests::sampling_is_the_circuit_core_s_sampler \
quantum_qudit::tests::digits_name_indices_highest_qudit_first \
quantum_qudit::tests::deterministic_and_hashable \
quantum_qudit::tests::every_platform_gives_the_same_bits \
engine::qudit::tests::a_job_runs_and_says_what_it_is \
engine::qudit::tests::what_a_job_leaves_out_has_its_default \
engine::qudit::tests::at_d_two_the_counts_are_the_exact_method_s \
engine::qudit::tests::every_refusal_has_its_code \
engine::qudit::tests::a_sealed_answer_verifies_follows_its_schema_and_reproduces; do
grep -q "^test $t \.\.\. ok$" "$RUNNER_TEMP/qudit.log" || { echo "::error::$t did not run and pass"; exit 1; }
done
- name: The conformance set, byte for byte
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
cargo test --locked --release --no-default-features --features quantum_engine,quantum_receipt --test qudit_conformance -- --nocapture 2>&1 | tee "$RUNNER_TEMP/conformance.log"
grep -qE '^test result: ok\. 4 passed; 0 failed' "$RUNNER_TEMP/conformance.log" || { echo "::error::the qudit conformance set differs here ($(uname -sm))"; exit 1; }
grep -o 'results_blake3 [0-9a-f]*' "$RUNNER_TEMP/conformance.log" || true
# A second implementation, from the extension's text alone.
- name: The referee
shell: bash
run: python3 -I wai/quantum-conformance/tools/qudit_referee.py wai/quantum-conformance
- name: The command line's verb
shell: bash
working-directory: wai/wai-quantum-cli
run: |
set -euo pipefail
cargo test --locked --release --bin wai-quantum -- qudit:: 2>&1 | tee "$RUNNER_TEMP/verb.log"
grep -qE '^test result: ok\. 2 passed; 0 failed' "$RUNNER_TEMP/verb.log" || { echo "::error::the verb's tests did not all pass (2 expected)"; exit 1; }
cargo build --locked --release --bin wai-quantum
bin=target/release/wai-quantum
dir=$(mktemp -d)
"$bin" qudit example --d 6 > "$dir/req.json"
"$bin" qudit run "$dir/req.json" -a 00 --demo-key --json > "$dir/job.json"
"$bin" qudit check "$dir/job.json"
"$bin" verify "$dir/job.json"
if "$bin" qudit run <(echo '{"d": 5, "qudits": 1, "gates": []}') --demo-key 2> "$dir/err.txt"; then
echo "::error::d = 5 was not refused"; exit 1
fi
grep -q '\[J091\]' "$dir/err.txt" || { echo "::error::d = 5 was not refused with J091"; cat "$dir/err.txt"; exit 1; }
# Without warnings: a feature gate that leaves code unreachable or a value
# unused in one feature set shows here.
- name: Each feature set that holds the module builds, without warnings
shell: bash
working-directory: wai/wai-quantum
env:
RUSTFLAGS: -D warnings
run: |
set -euo pipefail
cargo check --locked --no-default-features --features quantum_qudit --lib
cargo check --locked --no-default-features --features quantum_engine --lib
cargo check --locked --no-default-features --features quantum_engine,quantum_receipt --lib
# The crates as a whole are not clippy-clean (CHANGELOG), so the qudit files are
# held to it alone: no lint may name one of them.
- name: No clippy warning in the qudit files
shell: bash
run: |
set -euo pipefail
(cd wai/wai-quantum && cargo clippy --locked --no-default-features --features quantum_engine,quantum_receipt --lib --tests) 2>&1 | tee "$RUNNER_TEMP/clippy.log" >/dev/null
(cd wai/wai-quantum-cli && cargo clippy --locked --bin wai-quantum --tests) 2>&1 | tee -a "$RUNNER_TEMP/clippy.log" >/dev/null
if grep -E -- '--> (src/(quantum_qudit|engine/qudit|qudit\.rs)|tests/qudit_conformance)' "$RUNNER_TEMP/clippy.log"; then
echo "::error::clippy warns in the qudit files"; exit 1
fi
bits:
name: the same bits · macos
needs: relevant
if: needs.relevant.outputs.run == 'true'
runs-on: macos
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
# launchd's PATH omits cargo on the macOS host runner.
- name: Install Rust 1.99.1
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.99.1
rustup toolchain install 1.99.1 --profile minimal
rustup default 1.99.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: The pinned bits and the conformance set, in a debug build and a release build
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
export PATH="$HOME/.cargo/bin:$PATH"
for profile in "" "--release"; do
nice -n 10 cargo test --locked $profile --no-default-features --features quantum_engine,quantum_receipt --lib -- \
quantum_qudit::tests::every_platform_gives_the_same_bits 2>&1 | tee "$RUNNER_TEMP/bits.log"
grep -qE '^test result: ok\. 1 passed; 0 failed' "$RUNNER_TEMP/bits.log" || { echo "::error::the pinned bits differ here ($(uname -sm), ${profile:-debug})"; exit 1; }
nice -n 10 cargo test --locked $profile --no-default-features --features quantum_engine,quantum_receipt --test qudit_conformance -- --nocapture 2>&1 | tee "$RUNNER_TEMP/vectors.log"
grep -qE '^test result: ok\. 4 passed; 0 failed' "$RUNNER_TEMP/vectors.log" || { echo "::error::the conformance set differs here ($(uname -sm), ${profile:-debug})"; exit 1; }
grep -o 'results_blake3 [0-9a-f]*' "$RUNNER_TEMP/vectors.log" || true
done
wasip2:
name: the module and the conformance set under wasm32-wasip2 (wasmtime)
needs: relevant
if: needs.relevant.outputs.run == 'true'
runs-on: linux
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.99.1 with the wasm32-wasip2 target
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.99.1
rustup toolchain install 1.99.1 --profile minimal
rustup default 1.99.1
rustup target add --toolchain 1.99.1 wasm32-wasip2
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# The release binary, pinned by version and SHA-256, as every WAI workflow that runs wasmtime pins it
# (scripts/check-wasmtime-pin.py), and every run passes the two settings that fix its floats.
- name: Install wasmtime 50.0.1
shell: bash
run: |
set -euo pipefail
[ "$(uname -m)" = x86_64 ] || { echo "::error::the pinned wasmtime archive is x86_64; this host is $(uname -m)"; exit 1; }
if ! command -v xz >/dev/null 2>&1; then
SUDO=""; [ "$(id -u)" -ne 0 ] && SUDO="sudo"
$SUDO apt-get update -qq
$SUDO apt-get install -y -qq xz-utils
fi
v=50.0.1
f="wasmtime-v$v-x86_64-linux.tar.xz"
curl --proto '=https' --tlsv1.2 -sSfL -o "$RUNNER_TEMP/$f" \
"https://github.com/bytecodealliance/wasmtime/releases/download/v$v/$f"
echo "685466455dd42a14774a86c36c8f2e45cbb9bd6d92a850139315df60a75498a5 $RUNNER_TEMP/$f" | sha256sum -c -
tar -xJf "$RUNNER_TEMP/$f" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/wasmtime-v$v-x86_64-linux" >> "$GITHUB_PATH"
# A debug build, so integer overflow panics instead of wrapping.
- name: The module's tests and the conformance set under wasmtime, to the pinned bits
shell: bash
working-directory: wai/wai-quantum
env:
CARGO_TARGET_WASM32_WASIP2_RUNNER: wasmtime run -W nan-canonicalization=y -W relaxed-simd-deterministic=y
run: |
set -euo pipefail
cargo test --locked --target wasm32-wasip2 --no-default-features --features quantum_engine,quantum_receipt --lib -- quantum_qudit:: engine::qudit:: 2>&1 | tee "$RUNNER_TEMP/wasip2.log"
grep -qE '^test result: ok\. 26 passed; 0 failed; 1 ignored' "$RUNNER_TEMP/wasip2.log" || { echo "::error::the qudit tests did not all pass under wasip2 (26 expected)"; exit 1; }
grep -q '^test quantum_qudit::tests::every_platform_gives_the_same_bits \.\.\. ok$' "$RUNNER_TEMP/wasip2.log" || { echo "::error::the pinned bits differ under wasip2"; exit 1; }
cargo test --locked --target wasm32-wasip2 --no-default-features --features quantum_engine,quantum_receipt --test qudit_conformance -- --nocapture 2>&1 | tee "$RUNNER_TEMP/vectors.log"
grep -qE '^test result: ok\. 4 passed; 0 failed' "$RUNNER_TEMP/vectors.log" || { echo "::error::the conformance set differs under wasip2"; exit 1; }
grep -o 'results_blake3 [0-9a-f]*' "$RUNNER_TEMP/vectors.log" || true