wai-quantum 0.6.10–0.6.11: one reader, the engine in the library, the command line, the engine in a browser tab, Quantum Studio for the browser and the desktop, and an assistant on a local model #364

Closed
dcharlot wants to merge 12 commits from wai/quantum-four-surfaces into main

2026-10-20

Transaction Science
Quantum Studio: data-embedded, for a host page with a heading of its own
Some checks failed
wai-quantum Metal member / member · Metal (macos) (pull_request) Has been cancelled
wai-quantum Metal member / member · Metal absent (linux) (pull_request) Has been cancelled
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Has been cancelled
wai-quantum FPGA member / member · FPGA simulation absent (linux) (pull_request) Has been cancelled
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Has been cancelled
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:b140) (pull_request) Has been cancelled
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:401e) (pull_request) Has been cancelled
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Has been cancelled
wai-quantum CUDA member / member · CUDA absent (linux) (pull_request) Has been cancelled
wai-quantum command line / command line · linux (pull_request) Has been cancelled
wai-quantum command line / command line · macos (pull_request) Has been cancelled
wai-pack / wai-pack · linux (pull_request) Has been cancelled
wai-pack / wai-pack · macos (pull_request) Has been cancelled
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been cancelled
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been cancelled
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Has been cancelled
joule-moq-room room service / joule-moq-room, every target (pull_request) Has been cancelled
wai-quantum on every processor / emulated · armv7-unknown-linux-gnueabihf (pull_request) Successful in 59s
wai-quantum on every processor / emulated · loongarch64-unknown-linux-gnu (pull_request) Successful in 1m40s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 6m58s
wai-quantum on every processor / emulated · powerpc64-unknown-linux-gnu (pull_request) Successful in 2m42s
wai-quantum on every processor / emulated · powerpc64le-unknown-linux-gnu (pull_request) Successful in 2m22s
wai-quantum on every processor / emulated · riscv64gc-unknown-linux-gnu (pull_request) Successful in 41s
wai-quantum on every processor / emulated · s390x-unknown-linux-gnu (pull_request) Successful in 2m21s
wai-quantum on every processor / emulated · sparc64-unknown-linux-gnu (pull_request) Successful in 3m11s
wai-quantum on every processor / emulated · i686-unknown-linux-gnu (pull_request) Successful in 2m54s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 10m32s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:38:39 -04:00
Transaction Science
Quantum Studio: an assistant on a local model, with the engine as its tools and every program checked before it is offered
The Assistant pane talks to a model on this machine: any server with the chat-completions interface and tool calls (the JouleClaw runtime, a llama.cpp server). Its address goes under "Model…", and nothing leaves the machine unless that address points elsewhere. In the desktop app the app itself makes the call (`chat` and `models` commands, http and https only).

- The model's tools are the Studio's engine: read the program, lint, draw, plan and run. Its first turn must call one, so every answer starts from the engine.
- Every program it proposes is read by the engine here. One that does not parse goes back once with the engine's reason. One that parses is run with the settings the model ran it with, so the counts it quoted are the counts shown, and then offered with Apply. A program the model ran through a tool but did not show is offered the same way.
- A figure in its prose that no tool returned is marked "Not from a run". LaTeX is shown as Unicode, and answers are plain text with bold and code built as nodes, never HTML.
- test/studio.test.mjs drives it against a scripted model server: the tool call run on the engine, a broken proposal sent back with its reason, the corrected one checked and run, the tools and the grounding rule in every call, and Apply.
- test/assistant-live.mjs drives it against a real server. Against a local 35B mixture-of-experts model (about 3B parameters active per token), every answer began with an engine call. The GHZ program it wrote was checked and run, with the counts it quoted equal to the counts shown, and a "50/50" it gave itself was marked as not from a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:38:39 -04:00
Transaction Science
Quantum Studio: one interface for the browser and the desktop app, on the job service's engine
wai/quantum-studio is an editor for OpenQASM programs with three places to run them: this browser (the engine in WebAssembly, in a worker), this computer (the engine built natively, in the desktop app), and the job service. Each returns the same job, and the Studio shows it the same way and checks its receipt where it runs. The same request and seed give the same counts in every place.

- The editor highlights OpenQASM, completes the standard gates and the program's own registers, marks the engine's diagnostics on their lines, and draws the circuit and shows the plan as the program is typed. Ctrl/⌘+Enter runs; Escape cancels.
- A result shows its method and why, its accuracy class, counts, expectation values, amplitudes with probability and phase, and a receipt naming whose key signed it, checked on this device, which can be downloaded. The program and the history of runs are kept on the device; a link carries the program in its fragment.
- It takes the host's design tokens (tokens.css when it stands alone) and follows the light and dark schemes.
- test/studio.test.mjs runs it in a browser: lint, draw and plan; a run checked here; an error on its line; any angle; the service giving the counts run here, shot for shot; Ctrl+Enter; the program and the history surviving a reload; no sideways scroll at a phone's width.

wai/wai-quantum-desktop is the app: the Studio's build around the engine natively. Each job runs in a process of its own (the binary as `worker`), so Cancel ends it and a large one cannot take the app with it. The worker plans and runs, and the app seals the answer with this user's key, the command line's. Jobs and programs are saved under ~/Documents/Quantum Studio/. `check` runs a Bell pair through the worker, sealed and verified, with no window.

engine::job splits into plan_and_run and seal (run is both), for hosts that run a job away from their key. wai-quantum-cli gains a library target for its key module, shared with the app.

.github/workflows/wai-quantum-studio.yml builds the engine's browser package, builds the Studio and runs its test, and on macOS runs the app's tests, clippy and check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:38:28 -04:00
Transaction Science
wai-quantum engine in a page: one job function for every host, and the engine in the browser
- engine::job: a job planned, run, sealed with the host's key and returned
  in the service's form (run), its check (verify), a key's did:key (did_of)
  and a program's lint. The command line now calls these; the browser
  binding calls the same.
- engine::draw: the circuit drawer, moved from the command line.
- The engine runs on wasm32-unknown-unknown: a result there carries no
  elapsed_ms (a tab has no clock std reads), and the cut-rank order search
  runs its seeds in turn where there are no threads, finding the same orders.
- A program that measures in the middle on the state vector is admitted
  with the job's memory margin counted once, as trajectories count it, not
  once per state: two 256 MiB margins had left no room in 512 MiB, and the
  service refused a qubit it could hold.
- wai-web, feature quantum_engine (off by default, for the IDE's bundle):
  QuantumEngine (run, plan, methods, signer_did) signing with the page's
  key, and engine_lint, engine_draw and engine_verify. Tested natively and
  in wasm32 under Node, where a job runs and verifies, a changed result is
  refused, and every method a tab holds runs; wai-web-wasm.yml runs both
  with their counts.
- wai-rs: feature quantum_engine re-exports the engine as wai::engine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:38:28 -04:00
Transaction Science
wai-quantum-cli: the command line on the job service's engine, installable
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 13:38:28 -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 13:38:27 -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 13:38:27 -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 13:38:27 -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 13:38:27 -04:00