wai-quantum: the job service's engine in the library, and an installable command line on it #359

Closed
dcharlot wants to merge 7 commits from wai/quantum-engine into main

2026-10-20

Transaction Science
wai-quantum-cli: the command line on the job service's engine, installable
All checks were successful
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 14s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 12s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:b140) (pull_request) Successful in 3m44s
wai-quantum CUDA member / member · CUDA absent (linux) (pull_request) Successful in 22s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:401e) (pull_request) Successful in 4m34s
wai-quantum FPGA member / member · FPGA simulation absent (linux) (pull_request) Successful in 18s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m24s
wai-quantum Metal member / member · Metal absent (linux) (pull_request) Successful in 21s
wai-quantum neural-processor member / member · neural processor absent (linux) (pull_request) Successful in 18s
wai-quantum OpenCL member / member · OpenCL absent (linux) (pull_request) Successful in 20s
wai-quantum-qpu / clients against their contracts (linux) (pull_request) Successful in 19s
wai-quantum matrix-extension member / member · matrix extension, emulated (aarch64 Linux) (pull_request) Successful in 18s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m40s
wai-quantum service / service · linux (pull_request) Successful in 37s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 8m17s
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Successful in 31s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 18s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 25s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 12s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 9s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 12s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 11s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 14m3s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m10s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m7s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m16s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m12s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 3m47s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m45s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m22s
A new crate, wai-quantum-cli, whose binary is wai-quantum. It depends on the
wai-quantum library alone, so `cargo install wai-quantum-cli` can install it.

- run: an OpenQASM program planned and run as the service runs it
  (wai_quantum::engine), signed with this user's key; --json prints the job
  as the service returns it. Shots, seed, method, observables, amplitudes,
  noise and method options; an unknown flag or noise channel is an error.
- plan, lint (the line of the first problem), draw (the circuit as text,
  gates packed into columns, conditions in a legend).
- submit: the same job on the service (feature `service`, on by default),
  waiting for a long one.
- verify: a job's receipt from run, submit or the service, and every
  receipt the research tools sign; a changed result is INVALID.
- key: this user's did:key; --key FILE and --demo-key as before.
- methods: each method's reach in a job's memory here.
- mcp: run, plan, lint, draw, verify and the method list for an agent,
  over stdio; runs stay on this machine.
- lab: the earlier wai-quantum command, moved here from wai-rs unchanged
  (wai:: paths now wai_quantum::), its key handling shared with run.
- completions for bash, zsh, fish, elvish and PowerShell.
- Feature `metal`: the GPU state vector on macOS. With no default features
  it builds for wasm32-wasip2.

wai-rs loses the wai-quantum bin and its cli_keys feature. The wai README's
quickstart now uses the new crate. smoke.sh exercises every command, and
.github/workflows/wai-quantum-cli.yml runs the tests, clippy with and
without submit, smoke.sh, and the WASI component against the native build,
byte for byte; on macOS also a run on the GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 08:51:14 -04:00
Transaction Science
wai-quantum engine: one receipt form for every host; an unknown noise channel refused; did_key
- engine::receipt is the service's receipt form, moved: a result sealed over
  the request and the result in their RFC 8785 canonical text, and checked.
  The service keeps its key file and seals with it; the command line seals
  with the user's key in the same form, and one verify checks both. The
  first receipts' form still verifies.
- A job's noise naming a channel the model does not know is refused with
  the channels it knows (catalog::NOISE_CHANNELS). It was read as no noise,
  so a misspelt channel ran the circuit noiseless.
- quantum_receipt::did_key: an Ed25519 key's did:key, held to the W3C
  method's example, for signers that depend on the library alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 08:51:03 -04:00
Transaction Science
wai-quantum: the job service's engine in the library (feature quantum_engine)
The service's planner (catalog), runner (run) and dynamic-circuit walk
(dynamic) move unchanged into wai_quantum::engine, so every host that runs a
job plans and answers it as the service does. The service keeps what is its
own: HTTP, the job queue and its limits, energy metering, its signed
receipts, MCP and its examples.

- The GPU state vector is behind quantum_sv_metal: without it, the plan
  says the build has none, and the build still compiles for any target.
- The feature reads JSON numbers correctly rounded
  (serde_json/float_roundtrip), as the service always has.
- The test of the service's own examples stays with the service; the
  Grover test, which builds its program with the toolchain, runs where
  quantum_toolchain is on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 08:28:56 -04:00
Transaction Science
wai-web wasm32 CI: the native unit tests are 35, with the IDE binding's import, JSON and signing-key tests
All checks were successful
wai-quantum FPGA member / member · FPGA simulation absent (linux) (pull_request) Successful in 23s
wai-quantum Metal member / member · Metal absent (linux) (pull_request) Successful in 29s
wai-quantum neural-processor member / member · neural processor absent (linux) (pull_request) Successful in 20s
wai-quantum OpenCL member / member · OpenCL absent (linux) (pull_request) Successful in 22s
wai-quantum-qpu / clients against their contracts (linux) (pull_request) Successful in 20s
wai-quantum service / service · linux (pull_request) Successful in 51s
wai-quantum matrix-extension member / member · matrix extension, emulated (aarch64 Linux) (pull_request) Successful in 19s
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Successful in 30s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 6m26s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 24s
wai-quantum service / service · macos (pull_request) Successful in 39s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 11s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 17s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 14s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m45s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m47s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 8m39s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 17s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 25s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 12s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 9s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 14m38s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 13s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 12s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m9s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m7s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m16s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m21s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m44s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m26s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 08:28:45 -04:00
Transaction Science
wai-quantum 0.6.10: the changelog, the qasm module in the README, the version in every lockfile that pins it
Some checks failed
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 17s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 25s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 13s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 13m35s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 10s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 13s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 22s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m9s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m8s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Failing after 2m35s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m17s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m58s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 12m45s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m6s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 19s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 44s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 4m23s
wai-pack / wai-pack · macos (pull_request) Successful in 1m3s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 14s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m8s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 26s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 5m45s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 21s
wai-quantum service / service · macos (pull_request) Successful in 32s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 10s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 14s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 12s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m13s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m27s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 3m43s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 04:55:28 -04:00
Transaction Science
wai-quantum CLI and IDE: a receipt names its signer by its key's did:key
The CLI signed every receipt as "did🔑wai-quantum-cli" and the IDE as
"did🔑quantum-ide", labels that name no key. Now that each signs with
its own key, the receipt's signer_id is that key's Ed25519 did:key
(wai::signer_id::did_key), so a verifier reads the signer from the id as
jwp-receipts §7.1 describes. The IDE binding gains signer_did() for the
page to show it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 04:28:01 -04:00
Transaction Science
wai-quantum: one OpenQASM reader for the service, the CLI and the browser IDE; receipts signed with the signer's own key
The OpenQASM reader moves from the service into the library as
wai_quantum::qasm (feature quantum_qasm). The service, `wai-quantum run --qasm`
and the browser IDE's import now read a program the same way and refuse the
same programs: two registers, broadcast gates and comments read as the
service reads them, where the IDE's line reader dropped what it did not know.

- qasm::dyadic_circuit takes a program whose measurements all come at the
  end, and refuses one that measures and then acts, with the reason.
- quantum_toolchain::from_qasm, the older line reader, refuses what it cannot
  take (more than one register, reset, gate definitions, if/while/for, a gate
  after a measurement, two statements on one line) and names the full reader,
  instead of dropping the line.
- wai-web: the IDE binding builds its JSON with serde_json, so a quote or a
  control character in a program or an error no longer breaks the reply.
  set_signing_key, public_key_hex and key_is_demo let a page sign receipts
  with its own key; without one it signs with the published demo key and
  says so.
- The CLI signs with --key FILE, $WAI_QUANTUM_KEY, or this user's key at
  $XDG_CONFIG_HOME/wai/quantum-key (~/.config/wai/quantum-key), made from the
  operating system's random source with mode 0600 on first use. --demo-key
  keeps the published key, with a note that such a receipt shows the result
  is unaltered, not who signed it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 04:17:18 -04:00