wai-quantum: bring your own quantum (an open provider protocol, the person's providers on every surface) #516

Closed
dcharlot wants to merge 11 commits from wai/quantum-qbyoq into main

2026-10-27

Transaction Science
wai-quantum: the route rule reads plainly; a project's test.sh takes a relative command path
All checks were successful
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 5m30s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 29s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 25s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 10m31s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 2m40s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (pull_request) Successful in 1m39s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 9m46s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 25s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 1m0s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 6m7s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 59m24s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 19m13s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 19s
wai-quantum command line / command line · macos (pull_request) Successful in 47s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 32s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m15s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 23s
wai-quantum for Python / python · macos (pull_request) Successful in 1m20s
wai-quantum-qpu / credentials in the keychain (macos) (pull_request) Successful in 18s
wai-quantum service / service · macos (pull_request) Successful in 49s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 12s
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (pull_request) Successful in 12m17s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 16s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 16s
wai-quantum studio and desktop / desktop app · macos (pull_request) Successful in 2m51s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m41s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m51s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 9m31s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 7m0s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 15m50s
- engine::guide's route rule ends "and nowhere else": the service's
  instructions join every rule on one line, where the old ending and the
  signing-key rule read together as a comparison to the prose check.
- test.sh makes a relative WAI_QUANTUM absolute before it changes to the
  project's directory, and smoke.sh runs the binary by an absolute path:
  CI gives it ./target/release/wai-quantum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:18:38 -04:00
Transaction Science
wai-quantum: agents may use the person's own providers; one tool list for every reader
Some checks failed
wai-quantum studio and desktop / studio · browser (pull_request) Has been cancelled
wai-quantum studio and desktop / desktop app · macos (pull_request) Has been cancelled
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Has been cancelled
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Has been cancelled
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Has been cancelled
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:401e) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Has been cancelled
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Has been cancelled
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Has been cancelled
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Has been cancelled
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux (pull_request) Has been cancelled
WAI examples / WAI examples · portable · linux (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Has been cancelled
- engine::guide: the route rule allows a quantum provider the person
  added themselves, only for a run they ask for, and the Agent Skill says
  how (dry run, cost, the person's yes).
- The stdio MCP server's tools() now includes the provider tools, so
  tools/list, the generated llms.txt, llms-full.txt, the AGENTS.md block
  and the skill's tool reference list the same tools.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:07:14 -04:00
Transaction Science
wai: the open provider protocol, and Bring your own quantum
- extensions/quantum-providers.md: wai.quantum.provider/1, its two
  transports, its messages and error codes, the program in a device's
  own gates with exact angles, the six operations, the bit order, the
  cost and confirmation rules, what the receipt proves and what it does
  not, the conformance vectors and the reference provider.
- wai-quantum-qpu/bring-your-own-quantum.md: what is free, adding a
  provider of each kind with its credential in the keychain, running on
  it from the command line, an agent and the desktop, the reference as a
  template, the receipt, and what a person does to connect a real device.
- The READMEs of wai-quantum-qpu, the command line, the engine and the
  job service (which never routes to a provider or takes a credential),
  and the CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:00:40 -04:00
Transaction Science
Quantum Studio and the desktop app: Your hardware, with a cost dialog
- Desktop: providers_list, provider_estimate and run_on_provider
  commands; the app reads the credential from the keychain, seals the
  counts with the user's key, and refuses a run that is not free unless
  the page confirms it.
- Studio: a "Your hardware" switch. In the desktop app it lists the
  person's providers, asks for the estimate first and shows a dialog
  before a run that is not free; in a browser tab it says such runs go
  through the desktop app or the command line, since a tab must not hold
  a provider's credential.
- Tests: test/hardware.test.mjs (the switch's logic without a browser),
  a check in the browser test, and a desktop test of the estimate, the
  refusal and the sealed run. The Studio workflow runs the first and
  pins the last, and follows wai-quantum-qpu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:00:32 -04:00
Transaction Science
wai-quantum CLI: providers verbs, run --provider, and three MCP tools
- providers add|list|remove|describe|test|free|reference: the person's
  own providers in their registry, a credential read from standard input
  (never a command line) into the keychain, or named by an environment
  variable; describe and the conformance test; what anyone can use free;
  and the reference provider served by this binary, as a template.
- run --provider NAME [--dry-run] [--yes]: the plan with the exact native
  compile, its check and the provider's estimate; a run that is not free
  refused (exit 3) until --yes; the counts sealed with this user's key,
  checked by verify.
- MCP: providers_list, provider_estimate and run_on_provider; the last
  says it can spend the person's money and refuses without
  confirm_cost: true when the run is not free.
- A `providers` feature (default) carries it, so the WASI build without
  default features stays as it was.

CI: the command line's workflow follows wai-quantum-qpu and pins the five
end-to-end tests by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:00:32 -04:00
Transaction Science
wai-quantum-qpu: bring your own quantum (open provider protocol, reference, registry, jobs)
- open_provider: the open provider protocol, wai.quantum.provider/1, over
  HTTP (curl, a credential only over https or to this machine) or a local
  process (one JSON line each way, the credential in its environment);
  a program travels in the device's gates with every angle an exact
  dyadic fraction of a turn, and its OpenQASM 3 beside it.
- reference: the protocol around the exact simulator, served both ways
  (wai-qpu reference --stdio | --http ADDR): the provider the tests run
  against, and the template to copy. Free, or priced per shot or job in
  exact decimals; polls, readout error and a credential checked by hash.
- conformance: the checker and its vectors (conformance/provider-v1.json),
  with the reference's counts pinned; jobs run only when free or allowed.
- registry: the person's list in their configuration directory, holding
  no credential; credentials in the keychain (the system security tool,
  or secret-tool), else a 0600 file, and every listing says which.
- job: the dry run (exact native compile, the check by simulation, the
  provider's estimate and billing unit), the refusal of a run that is not
  free until it is confirmed, and the seal of its counts by the engine.
- Provider gains details, estimate, a seeded submit and cancel, with
  defaults, so the three built-in clients keep working unchanged.

CI: the QPU workflow pins the three test binaries' counts and the new
tests by name, and a macOS leg runs the keychain test in its own
keychain file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:00:17 -04:00
Transaction Science
wai-quantum engine: a job on the person's own provider, read, compared and sealed
engine::provider says what a provider job may ask (counts of a program
whose measurements come at the end and whose angles are dyadic, so it
compiles exactly to a device's gates), turns the device's counts into a
result labelled measured with the circuit's exact distribution beside
them (total variation distance, Hellinger fidelity, and what the shots
alone would leave), and seals it so job::verify checks it.

catalog::read refuses a request that names a provider, so a host that
reaches none (the job service) never runs one on its own methods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:00:17 -04:00
Transaction Science
wai-quantum-py: release wheels on the command line tag; changelog and README
Some checks failed
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 36s
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (pull_request) Has been cancelled
wai-quantum command line / command line · macos (pull_request) Has been cancelled
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Has been cancelled
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Has been cancelled
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum Metal member / member · Metal (macos) (pull_request) Has been cancelled
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Has been cancelled
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Has been cancelled
wai-quantum for Python / python · macos (pull_request) Has been cancelled
wai-quantum service / service · macos (pull_request) Has been cancelled
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Has been cancelled
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Has been cancelled
wai-quantum studio and desktop / desktop app · macos (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Has been cancelled
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Has been cancelled
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Has been cancelled
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Has been cancelled
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
wai-quantum-py-release.yml builds the abi3 wheels on a wai-quantum-cli-v*
tag and attaches each with its SHA-256 to that forge release, as the
command line archives are (release/publish.sh, over the private network):
macOS arm64 and x86_64 (cross-built on the Apple-silicon runner), Linux
x86_64 and arm64 as manylinux2014 (maturin with zig 0.16.0, so the
runner glibc does not leak into the wheel; checked: the module needs
GLIBC_2.17 at most), and Windows x86_64. Each wheel that runs on its runner
is installed alone on Python 3.9 and runs tests/smoke.py first. Nothing is
published to a package index.

The changelog entry (wai/CHANGELOG.md), the crate README naming
engine::svg and the package, and ci/check.sh waiting on the service it
stops so the shell prints no job notice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:53:48 -04:00
Transaction Science
wai-quantum engine::svg: every mark keeps its colour without the style sheet
A page that strips <style> from what it shows (a notebook sanitising an
untrusted output) would leave unstyled lines with no stroke and the
background rectangle filled black. Each line and path now carries a stroke
in the text colour, each text and dot a fill, each box, ring and meter an
outline with no fill, the background none and each key swatch its hand
colour; the style sheet still overrides them all. A sixth test checks every
element of a drawing for its attribute. The doc notebooks are written again
with the new drawing, and ci/check.sh expands an empty array the way the
bash macOS ships accepts under set -u.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:53:31 -04:00
Transaction Science
wai-quantum-py: WAI Quantum in Python and notebooks, in-process
A new crate, wai/wai-quantum-py, built by maturin 1.15.0 into one abi3 wheel
per platform (pyo3 0.29.3, Python 3.9 on), module wai_quantum. Its extension
module wraps the shared job engine and nothing else: run, plan, lint, draw
(text and the engine SVG), layout, critique, improve, shortcuts,
equivalent, verify, seal, canonical, digest, methods, accuracy_classes and
history, values crossing one to one with JSON (NaN, integers past 64 bits
and non-string keys refused). A job is the service form as a plain dict
with helpers (counts, probabilities, expectations, amplitudes, method,
accuracy, receipt); Key reads and writes the command line key files and
finds the same user key; bloch gives each qubit reduced state from the
engine expectation values. A refusal raises EngineError with the engine
message, its line, and a code slot for the engine diagnostic codes.

Service is a client in the standard library alone for the job service
(submit, status, result, cancel, run), naming itself
wai-quantum-python/<version>, its receipts checked here offline.

Widgets (the widgets extra): Circuit (the engine drawing, gates clickable,
authorship marks from a history), Result, Receipt (the engine verdict) and
Bloch (drag to turn), each a plain ES module, each with static HTML (and
SVG) fallbacks that render without the widget library.

Five doc notebooks run in CI and are held to their stored outputs.
ci/check.sh is the whole check; 62 pytest tests hold the package to the
command line (same results, plans, lints, critiques, drawings, methods,
equivalence verdicts; receipts verified both ways; the same user key; the
digest recomputed from Python canonical bytes), to the service run locally,
and run the front ends under node on the payloads; Python 3.9 smoke with
the wheel alone. Workflow wai-quantum-py.yml runs it on linux and macos.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:53:31 -04:00
Transaction Science
wai-quantum engine: a circuit as a standalone SVG drawing (engine::svg)
The drawing the Studio makes from the layout, written once in the engine for
hosts with no page of their own (a notebook, a report, a file): the same
classes and geometry, a style sheet of its own scoped to .wq-circuit that
follows the text colour it is placed in, every number written to two
decimals so the same program writes the same bytes everywhere. Given whose
hand each operation is in, each gate is marked with its author and a key
under the drawing counts them; a condition legend and a note past 400
columns. Five tests: the Bell pair glyph by glyph, every layout item drawn
and the bytes repeatable, the authorship marks and key, escaping and number
writing, and the column cap.

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