open-standards/wai/quantum-conformance/intents/README.md
Transaction Science 8a3141366d determinism-tiers §5: CI validates the browser packages; the READMEs run CI's wasmtime
§5 said the browser crate's SIMD validation was done by hand, "which CI does
not check". Since "wai-web-wasm: the packages validate with relaxed SIMD and
threads off", wai-web-wasm.yml validates both bundles and
reach/record/wai_web_bg.wasm with relaxed SIMD and threads disabled. §5 now
says so, and says what CI still does not check: that they hold no other SIMD
instruction. The changelog gains the CI entry for this branch.

The commands that reproduce CI's wasmtime legs ran a stock wasmtime: the WAI
Quantum READMEs (English and Chinese), the bit_identity test's header, the WAI
README's edge example, and the conformance READMEs (quantum, qasm3, formats,
answers, intents). Each now passes -W nan-canonicalization=y
-W relaxed-simd-deterministic=y, as CI does. The determinism-cost run scripts
under wai/research keep their commands: they record runs already made.

The quantum docs check could not see that drift. For a `norun=ci:` block it
stripped every leading VAR=value before matching the command against the
workflow, and its pattern, \S*, did not read a quoted value. It now reads a
quoted or bare value, and when the workflow sets VAR (as an env: key or in a
script) the documented value must be one the workflow gives it, so
CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime is refused against a workflow that
sets it to the flagged runner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 12:29:00 -05:00

2.6 KiB

Intent conformance

Programs, what each must do (its intents), and the verdict the engine must give when the program runs as a job with them (wai_quantum::engine::verdict, the verdict page).

Path What
programs/ The programs and the references their intents name: a Bell pair, GHZ states built two ways, a Grover search written with cz and with cx, rotations that merge, twelve-qubit circuits that only checked rewrites or random inputs decide, a forty-qubit Clifford pair, a program that acts on what it measured, and programs that do not read until they are repaired.
repaired/ The program a repaired case must run, as the repair writes it.
manifest.json Each case: its program, its run (the job's other fields), its intents, and what its verdict must say (the manifest's expect says what each field means).
bundle.json The manifest's cases with every program and reference inline, for builds that read no files.

A case's verdict is held to its level (refused, parsed, executed, evidence, proof), to whether its intents hold, and to each intent's outcome, strength and check. A distribution's total variation distance is held within 1e-12 of a value known by hand: 0 for an exact match, 1/2 for a Bell pair against one outcome, and 2 · 0.02 · 0.98 = 0.0392 for a Bell pair whose bits each flip with probability 0.02. A sampled case holds the run's samples to a stated distribution by a stated test at a stated level, at a fixed seed: it is evidence, never proof, and its outcome is held to the manifest's. A refused case is held to the last code its refusal gives. Every level of the ladder has a case.

Native

cd wai/wai-quantum
cargo test --release --features full --test intent_conformance

Two tests: every case against its verdict, and the bundle held equal to the files. After changing a program or the manifest, write the bundle:

WAI_INTENT_BUNDLE_WRITE=1 cargo test --release --features full --test intent_conformance the_bundle_is_the_corpus

WASI (the edge)

CARGO_TARGET_WASM32_WASIP2_RUNNER='wasmtime run -W nan-canonicalization=y -W relaxed-simd-deterministic=y' \
  cargo test --target wasm32-wasip2 --features full --test intent_conformance

The cases come from the bundle compiled into the test.

Browser

wai-web's wasm32 tests (--features quantum_engine, under wasm-bindgen-test-runner) run every case of the bundle through the page's engine (QuantumEngine.run), and work each verdict out again with engine_verdict.

CI: wai-quantum-verdict.yml (native and wasm32-wasip2) and wai-web-wasm.yml (the browser build).